ERROR running force:source:convert: Expected file at path: D:\a\1\s\force-app\main\default

%3CLINGO-SUB%20id%3D%22lingo-sub-1716858%22%20slang%3D%22en-US%22%3EERROR%20running%20force%3Asource%3Aconvert%3A%20Expected%20file%20at%20path%3A%20D%3A%5Ca%5C1%5Cs%5Cforce-app%5Cmain%5Cdefault%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1716858%22%20slang%3D%22en-US%22%3E%3CP%3EHI%20All%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%20for%20reading%20my%20issue.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20deploy%20the%20changes%20to%20the%20target%20Salesforce%20org.%20While%20doing%20that%20I%20am%20using%20the%20below%20code%20to%20deploy.%20But%20the%20below%20is%20deploying%20only%20the%20components%20ending%20with.cls%2C%20but%20I%20want%20all%20the%20components%20to%20be%20deployed%20to%20target%20org%20irrespective%20whether%20it%20is%20ending%20with%20.cls%20or%20not.%26nbsp%3B%3C%2FP%3E%3CP%3ECould%20someone%20suggest%20where%20i%20am%20going%20wrong%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%23%26nbsp%3BPowershell%26nbsp%3Bscript%26nbsp%3Bfor%26nbsp%3Bpartial%26nbsp%3Bbuilds%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eecho%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Entering%26nbsp%3BPowershell%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eecho%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%24env%3C%2FSPAN%3E%3CSPAN%3E%3AWORKSPACE%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eecho%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Cleaning%26nbsp%3Btemp%26nbsp%3Bdirectory%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23Remove-Item%26nbsp%3B-recurse%26nbsp%3Btemp%26nbsp%3B-Force%26nbsp%3B%7C%26nbsp%3BOut-Null%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24files%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3D%26nbsp%3Bgit%26nbsp%3Bdiff-tree%26nbsp%3B-r%26nbsp%3B--no-commit-id%26nbsp%3B--name-only%26nbsp%3B--diff-filter%3DACMRT%26nbsp%3BHEAD~%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BHEAD%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eecho%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%24files%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%23Gives%26nbsp%3Bthe%26nbsp%3Bname%26nbsp%3Bof%26nbsp%3Bfile%26nbsp%3Balong%26nbsp%3Bwith%26nbsp%3Bits%26nbsp%3Bpath%26nbsp%3B%2Cthat%26nbsp%3Bhas%26nbsp%3Bbeen%26nbsp%3Bchanged%2C%26nbsp%3Bthe%26nbsp%3Blastest%26nbsp%3Bcommit%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3Eecho%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Re-creating%26nbsp%3Btemp%26nbsp%3Bdirectory%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Enew-item%26nbsp%3B-Name%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22temp%22%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B-Force%26nbsp%3B-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7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23%26nbsp%3Becho%26nbsp%3B%22Copy%26nbsp%3Bpackage.xml%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23%26nbsp%3Becho%26nbsp%3BFA%7Cxcopy%26nbsp%3Bforce-app%5Cpackage.xml%26nbsp%3Btemp%5Cforce-app%5C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eecho%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Removing%26nbsp%3Bforce-app%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ERemove-Item%26nbsp%3B-recurse%26nbsp%3Bforce-app%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23create%26nbsp%3Bforce-app%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Enew-item%26nbsp%3B-Name%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22force-app%22%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B-Force%26nbsp%3B-ItemType%26nbsp%3Bdirectory%26nbsp%3B%7C%26nbsp%3BOut-Null%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EStart-Sleep%26nbsp%3B-s%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E5%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eecho%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Copying%26nbsp%3Bback%26nbsp%3Bcontents%26nbsp%3Bof%26nbsp%3Btemp%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECopy-Item%26nbsp%3Btemp%5Cforce-app%5C*%26nbsp%3Bforce-app%5C%26nbsp%3B-recurse%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Edir%26nbsp%3Bforce-app%26nbsp%3B-recurse%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1716858%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESalesforce%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

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

 

0 Replies