Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "depsync", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"author": "Dom Chen", | ||
@@ -28,4 +28,5 @@ "homepage": "http://www.idom.me/", | ||
"follow-redirects": "latest", | ||
"progress": "latest" | ||
"progress": "latest", | ||
"tspack": "^1.0.5" | ||
} | ||
} |
@@ -28,3 +28,2 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
const fs = require("fs"); | ||
const terminal = require('./Terminal'); | ||
const Utils = require('./Utils'); | ||
@@ -34,6 +33,6 @@ const CommandLine = require('./CommandLine'); | ||
const DepsTask = require('./tasks/DepsTask'); | ||
const VERSION = "1.1.1"; | ||
const VERSION = "1.1.2"; | ||
function printVersion() { | ||
terminal.log("Version " + VERSION + "\n"); | ||
Utils.log("Version " + VERSION + "\n"); | ||
} | ||
@@ -58,3 +57,3 @@ | ||
}); | ||
terminal.log(output); | ||
Utils.log(output); | ||
} | ||
@@ -70,3 +69,3 @@ | ||
if (commandOptions.errors.length > 0) { | ||
terminal.log(commandOptions.errors.join("\n") + "\n"); | ||
Utils.error(commandOptions.errors.join("\n") + "\n"); | ||
process.exit(1); | ||
@@ -87,3 +86,3 @@ } | ||
if (!fs.existsSync(configFileName)) { | ||
terminal.log("Cannot find a DEPS file at the specified directory: " + commandOptions.project + "\n"); | ||
Utils.error("Cannot find a DEPS file at the specified directory: " + commandOptions.project + "\n"); | ||
process.exit(1); | ||
@@ -90,0 +89,0 @@ } |
@@ -27,3 +27,2 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
const terminal = require('../Terminal'); | ||
const Utils = require("../Utils"); | ||
@@ -37,4 +36,5 @@ | ||
let item = this.item; | ||
terminal.log("【depsync】executing action: " + item.command); | ||
Utils.log("【depsync】executing action: " + item.command); | ||
Utils.exec(item.command, item.dir); | ||
Utils.log(""); | ||
callback && callback(); | ||
@@ -41,0 +41,0 @@ }; |
@@ -30,3 +30,2 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
const Config = require("../Config"); | ||
const terminal = require("../Terminal"); | ||
const RepoTask = require("./RepoTask"); | ||
@@ -74,9 +73,9 @@ const FileTask = require("./FileTask"); | ||
if (!config) { | ||
terminal.log("The DEPS config file is not a valid JSON file: " + this.configFile); | ||
Utils.error("The DEPS config file is not a valid JSON file: " + this.configFile); | ||
process.exit(1); | ||
} | ||
if (compareVersion(this.version, config.version) < 0) { | ||
terminal.log("DEPS file requires version: " + config.version); | ||
terminal.log("The current depsync version: " + this.version); | ||
terminal.log("Please update the depsync tool and then try again."); | ||
Utils.error("DEPS file requires version: " + config.version); | ||
Utils.error("The current depsync version: " + this.version); | ||
Utils.error("Please update the depsync tool and then try again."); | ||
process.exit(1); | ||
@@ -83,0 +82,0 @@ } |
@@ -33,3 +33,2 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
const ProgressBar = require("progress"); | ||
const terminal = require('../Terminal'); | ||
const Utils = require('../Utils') | ||
@@ -47,3 +46,3 @@ | ||
function unzipFile(filePath, dir) { | ||
terminal.log("Unzipping: " + filePath); | ||
Utils.log("Unzipping: " + filePath); | ||
let zip = new AdmZip(filePath); | ||
@@ -102,3 +101,3 @@ let entries = zip.getEntries(); | ||
let retryTimes = 0; | ||
terminal.log("Downloading: " + url); | ||
Utils.log("Downloading: " + url); | ||
loadSingleFileWithTimeOut(url, filePath, onFinish, options); | ||
@@ -109,3 +108,3 @@ | ||
retryTimes++; | ||
terminal.log("Downloading retry " + retryTimes + ": " + url); | ||
Utils.log("Downloading retry " + retryTimes + ": " + url); | ||
loadSingleFileWithTimeOut(url, filePath, onFinish, options); | ||
@@ -123,3 +122,3 @@ } else { | ||
} catch (e) { | ||
terminal.log("Cannot create directory: " + path.dirname(filePath)); | ||
Utils.error("Cannot create directory: " + path.dirname(filePath)); | ||
process.exit(1); | ||
@@ -177,3 +176,3 @@ } | ||
fileName = path.basename(fileName); | ||
terminal.log("【depsync】downloading file: " + fileName); | ||
Utils.log("【depsync】downloading file: " + fileName); | ||
let filePath = path.resolve(item.dir, fileName); | ||
@@ -193,3 +192,3 @@ Utils.deletePath(filePath); | ||
if (error) { | ||
terminal.log("Cannot download file : " + error.message); | ||
Utils.error("Cannot download file : " + error.message); | ||
process.exit(1); | ||
@@ -202,3 +201,3 @@ return; | ||
} catch (e) { | ||
terminal.log("Cannot unzip file: " + filePath); | ||
Utils.error("Cannot unzip file: " + filePath); | ||
process.exit(1); | ||
@@ -208,2 +207,3 @@ } | ||
Utils.writeHash(item); | ||
Utils.log(""); | ||
callback && callback(); | ||
@@ -210,0 +210,0 @@ } |
@@ -28,3 +28,2 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
const path = require('path'); | ||
const terminal = require("../Terminal"); | ||
const Utils = require("../Utils"); | ||
@@ -56,3 +55,3 @@ | ||
let name = path.basename(item.dir); | ||
terminal.log("【depsync】checking out repository: " + name + "@" + item.commit); | ||
Utils.log("【depsync】checking out repository: " + name + "@" + item.commit); | ||
Utils.deletePath(item.dir); | ||
@@ -65,2 +64,3 @@ Utils.createDirectory(item.dir); | ||
Utils.exec("git reset --hard FETCH_HEAD -q", item.dir); | ||
Utils.log(""); | ||
callback && callback(); | ||
@@ -67,0 +67,0 @@ }; |
@@ -178,2 +178,20 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
function formatString(format) { | ||
let objects = new Array(arguments.length); | ||
for (let index = 0; index < arguments.length; index++) { | ||
objects[index] = arguments[index]; | ||
} | ||
return objects.join(' '); | ||
} | ||
function log(message) { | ||
let text = formatString.apply(this, arguments) + "\n"; | ||
process.stdout.write(text); | ||
} | ||
function error(message) { | ||
let text = formatString.apply(this, arguments) + "\n"; | ||
process.stderr.write(text); | ||
} | ||
exports.joinPath = joinPath; | ||
@@ -186,1 +204,3 @@ exports.createDirectory = createDirectory; | ||
exports.exec = exec; | ||
exports.log = log; | ||
exports.error = error; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41769
4
14
967
+ Addedtspack@^1.0.5
+ Addedchokidar@4.0.1(transitive)
+ Addedreaddirp@4.0.2(transitive)
+ Addedtspack@1.0.5(transitive)
+ Addedtypescript-plus@3.1.5(transitive)