Skip to content

Commit 8ce69b9

Browse files
committed
Fix deploy error from git.
#17
1 parent 5566690 commit 8ce69b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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)