Skip to content

Commit f0ba353

Browse files
authored
Merge pull request #20 from xgeek-net/fix/gitdeploy
Fix deploy error from git.
2 parents 5566690 + cf7fafb commit f0ba353

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pipeline",
33
"description": "Be less busy, less mistake in Salesforce metadata deploy",
4-
"version": "2.0.1",
4+
"version": "2.0.2",
55
"private": false,
66
"main": "src/main.js",
77
"dependencies": {

src/class/GitApi.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,16 @@ class GitApi {
355355
NodeGit.Reset.reset(repos, commit, 3, {});
356356
})
357357
.then(function (success) {
358-
// Copy metadata from git folder to metadata folder
358+
// Copy metadata src folder from git into metadata folder
359359
let gitPath = self.getGitFolder(path.join('pipeline', self.pipeline.id));
360360
const rootDir = self.pipeline.path;
361361
if(rootDir) gitPath = path.join(gitPath, rootDir);
362+
gitPath = path.join(gitPath, 'src');
363+
if(!fse.pathExistsSync(gitPath)) {
364+
return reject(new Error('src folder is not found.'));
365+
}
362366
let metaPath = metadata.getMetadataFolder(self.pipeline.id);
367+
metaPath = path.join(metaPath, 'src');
363368
fse.copy(gitPath, metaPath, function(err){
364369
if (err) return reject(err);
365370
return resolve(success);

0 commit comments

Comments
 (0)