-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify bash function and support colors
- Loading branch information
1 parent
b097021
commit d67f277
Showing
4 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
'use strict'; | ||
exports.fs = require('./fs'); | ||
exports.getPaths = require('./getPaths'); | ||
exports.getSourceData = require('./getSourceData'); | ||
exports.getSourceResult = require('./getSourceResult'); | ||
exports.maybeClone = require('./maybeClone'); | ||
exports.openInBrowser = require('./openInBrowser'); | ||
exports.rootDir = require('./rootDir'); | ||
exports.setTarget = require('./setTarget'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
const fs = require('./fs'); | ||
const rootDir = require('./rootDir'); | ||
const path = require('path'); | ||
|
||
module.exports = setTarget; | ||
|
||
function setTarget(sourceResult) { | ||
return new Promise((resolve, reject) => { | ||
if (sourceResult && sourceResult.repoDir) { | ||
fs.write(path.normalize(rootDir + '/.bitcar_target'), sourceResult.repoDir); | ||
fs.commit((err) => { | ||
if (err) return reject(err); | ||
return resolve(sourceResult.repoDir); | ||
}); | ||
} | ||
}); | ||
} |