HI All,
Thanks in advance for reading my issue.
I am trying to deploy the changes to the target Salesforce org. While doing that I am using the below code to deploy. But the below is deploying only the components ending with.cls, but I want all the components to be deployed to target org irrespective whether it is ending with .cls or not.
Could someone suggest where i am going wrong?
# Powershell script for partial builds
echo "Entering Powershell"
echo $env:WORKSPACE
echo "Cleaning temp directory"
#Remove-Item -recurse temp -Force | Out-Null
$files = git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT HEAD~1 HEAD
echo $files #Gives the name of file along with its path ,that has been changed, the lastest commit
echo "Re-creating temp directory"
new-item -Name "temp" -Force -ItemType directory | Out-Null
foreach($file in $files)
{
echo "printing file name"
#Replace slash
$file = $file -replace "/","\"
#Copy files to temp directory
echo FA|xcopy $file temp\$file
echo $temp
#Check extension
$extn = [IO.Path]::GetExtension($file)
if ($extn -eq ".cls")
{
$metafile = $file + "-meta.xml"
echo FA|xcopy $metafile temp\$metafile
echo $temp
}
}
# echo "Copy package.xml"
# echo FA|xcopy force-app\package.xml temp\force-app\
echo "Removing force-app"
Remove-Item -recurse force-app
#create force-app
new-item -Name "force-app" -Force -ItemType directory | Out-Null
Start-Sleep -s 5
echo "Copying back contents of temp"
Copy-Item temp\force-app\* force-app\ -recurse
dir force-app -recurse