Skip to content

Commit

Permalink
fix(diff): throw error if file is missing in repository
Browse files Browse the repository at this point in the history
throw an error if the associated file is missing in the repository such as meta.xml
  • Loading branch information
azlam-abdulsalam committed Sep 18, 2023
1 parent 246a33a commit 4b27744
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/git/GitDiffUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export default class GitDiffUtils {
}
});

if(gitFiles.length==0)
throw new Error(`Unable to find the required file ${filePath} in Git.., Did you really commit the file?`)

let copyOutputFolder = outputFolder;
for (let i = 0; i < gitFiles.length; i++) {
outputFolder = copyOutputFolder;
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/package/diff/PackageComponentDiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ export default class PackageComponentDiff {
}
}
} catch (error) {

if(error.message.includes(`Unable to find the required file`))
throw error;

//Metadata resolver is not respecting forceignores at this stage
// So it fails on diff packages with post deploy, so lets ignore and move on
SFPLogger.log(
Expand Down

0 comments on commit 4b27744

Please sign in to comment.