Skip to content

Commit

Permalink
Merge pull request #20 from xgeek-net/fix/gitdeploy
Browse files Browse the repository at this point in the history
Fix deploy error from git.
  • Loading branch information
xgeek-net committed Jun 20, 2019
2 parents 5566690 + cf7fafb commit f0ba353
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pipeline",
"description": "Be less busy, less mistake in Salesforce metadata deploy",
"version": "2.0.1",
"version": "2.0.2",
"private": false,
"main": "src/main.js",
"dependencies": {
Expand Down
7 changes: 6 additions & 1 deletion src/class/GitApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,16 @@ class GitApi {
NodeGit.Reset.reset(repos, commit, 3, {});
})
.then(function (success) {
// Copy metadata from git folder to metadata folder
// Copy metadata src folder from git into metadata folder
let gitPath = self.getGitFolder(path.join('pipeline', self.pipeline.id));
const rootDir = self.pipeline.path;
if(rootDir) gitPath = path.join(gitPath, rootDir);
gitPath = path.join(gitPath, 'src');
if(!fse.pathExistsSync(gitPath)) {
return reject(new Error('src folder is not found.'));
}
let metaPath = metadata.getMetadataFolder(self.pipeline.id);
metaPath = path.join(metaPath, 'src');
fse.copy(gitPath, metaPath, function(err){
if (err) return reject(err);
return resolve(success);
Expand Down

0 comments on commit f0ba353

Please sign in to comment.