Skip to content

Commit cf30212

Browse files
authored
Getting downloaded source path.
1 parent 6f737cf commit cf30212

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

lib/promise/getRepository.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ module.exports = function (properties) {
99
repository: properties.repository || Constants.FrameworkRepository,
1010
branch : properties.branch
1111
}),
12-
tmp = properties.tmp = path.join(Constants.HomeDirectory, '.adapt', 'tmp', uuid.v1()),
13-
downloadedSource = path.join(tmp, (properties.repositoryName || Constants.FrameworkRepositoryName) + '-' + properties.branch);
12+
tmp = properties.tmp = path.join(Constants.HomeDirectory, '.adapt', 'tmp', uuid.v1());
1413

1514
return downloader.fetch(tmp)
16-
.then(function () {
17-
return fs.copyTree(downloadedSource, properties.localDir)
15+
.then(function (fileName) {
16+
return fs.copyTree(getDownloadedSourcePath(properties, fileName), properties.localDir)
1817
.then(function () {
1918
return properties;
2019
});
2120
});
22-
};
21+
};
22+
23+
function getDownloadedSourcePath(properties, fileName) {
24+
var fName = fileName ? fs.base(fileName, fs.extension(fileName)) : ((properties.repositoryName || Constants.FrameworkRepositoryName) + '-' + properties.branch);
25+
return path.join(properties.tmp, fName);
26+
}

0 commit comments

Comments
 (0)