zarro 1.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +10 -0
- package/README.md +260 -0
- package/gulp-tasks/.editorconfig +8 -0
- package/gulp-tasks/.git +1 -0
- package/gulp-tasks/.gitignore +9 -0
- package/gulp-tasks/.gitmodules +0 -0
- package/gulp-tasks/LICENSE +24 -0
- package/gulp-tasks/README.md +144 -0
- package/gulp-tasks/build.js +135 -0
- package/gulp-tasks/clean.js +37 -0
- package/gulp-tasks/cover-dotnet.js +56 -0
- package/gulp-tasks/default-report-generator.js +51 -0
- package/gulp-tasks/default-tools-installer.js +33 -0
- package/gulp-tasks/default.js +17 -0
- package/gulp-tasks/dotnet-publish.js +23 -0
- package/gulp-tasks/generate-reports.js +7 -0
- package/gulp-tasks/get-local-nuget.js +16 -0
- package/gulp-tasks/git-submodules.js +83 -0
- package/gulp-tasks/increment-package-json-version.js +12 -0
- package/gulp-tasks/increment-package-json-version.ts +17 -0
- package/gulp-tasks/install-tools.js +24 -0
- package/gulp-tasks/modules/add-stream-on-any-handler.js +31 -0
- package/gulp-tasks/modules/alter-package-json-version.js +64 -0
- package/gulp-tasks/modules/alter-package-json-version.ts +113 -0
- package/gulp-tasks/modules/are-all-dotnet-core.js +96 -0
- package/gulp-tasks/modules/ask.js +31 -0
- package/gulp-tasks/modules/ask.ts +41 -0
- package/gulp-tasks/modules/collect-files.js +15 -0
- package/gulp-tasks/modules/collect-files.ts +16 -0
- package/gulp-tasks/modules/config-generator.js +10 -0
- package/gulp-tasks/modules/defaults.js +9 -0
- package/gulp-tasks/modules/download-nuget.js +104 -0
- package/gulp-tasks/modules/ensure-folder-exists.js +21 -0
- package/gulp-tasks/modules/env-helpers.js +49 -0
- package/gulp-tasks/modules/env-helpers.ts +67 -0
- package/gulp-tasks/modules/env.js +364 -0
- package/gulp-tasks/modules/exec.js +257 -0
- package/gulp-tasks/modules/exec.ts +346 -0
- package/gulp-tasks/modules/fail-after.js +30 -0
- package/gulp-tasks/modules/fail-after.ts +34 -0
- package/gulp-tasks/modules/fallback.js +6 -0
- package/gulp-tasks/modules/find-dirs.js +39 -0
- package/gulp-tasks/modules/find-local-nuget.js +42 -0
- package/gulp-tasks/modules/find-npm-base.js +42 -0
- package/gulp-tasks/modules/fs.js +79 -0
- package/gulp-tasks/modules/gather-paths.js +23 -0
- package/gulp-tasks/modules/gather-paths.ts +29 -0
- package/gulp-tasks/modules/generate-env-help-for.js +30 -0
- package/gulp-tasks/modules/get-tools-folder.js +12 -0
- package/gulp-tasks/modules/git-push-tags.js +33 -0
- package/gulp-tasks/modules/git-push-tags.ts +42 -0
- package/gulp-tasks/modules/git-push.js +51 -0
- package/gulp-tasks/modules/git-tag.js +36 -0
- package/gulp-tasks/modules/gulp-dotnetcover.js +537 -0
- package/gulp-tasks/modules/gulp-git-tag-from-csproj.js +50 -0
- package/gulp-tasks/modules/gulp-git-tag-from-csproj.ts +71 -0
- package/gulp-tasks/modules/gulp-git-tag-from-package-nuspec.js +55 -0
- package/gulp-tasks/modules/gulp-increment-nuget-package-dependency-version.js +40 -0
- package/gulp-tasks/modules/gulp-increment-nuget-package-version.js +87 -0
- package/gulp-tasks/modules/gulp-increment-nuget-package-version.ts +122 -0
- package/gulp-tasks/modules/gulp-msbuild.js +1 -0
- package/gulp-tasks/modules/gulp-npm-run.js +40 -0
- package/gulp-tasks/modules/gulp-npm-run.ts +52 -0
- package/gulp-tasks/modules/gulp-nuget-pack.js +168 -0
- package/gulp-tasks/modules/gulp-nuget-restore.js +106 -0
- package/gulp-tasks/modules/gulp-nunit-runner/.jshintrc +5 -0
- package/gulp-tasks/modules/gulp-nunit-runner/.npmignore +16 -0
- package/gulp-tasks/modules/gulp-nunit-runner/LICENSE +21 -0
- package/gulp-tasks/modules/gulp-nunit-runner/README.md +300 -0
- package/gulp-tasks/modules/gulp-nunit-runner/index.js +1 -0
- package/gulp-tasks/modules/gulp-nunit-runner/lib/index.js +205 -0
- package/gulp-tasks/modules/gulp-nunit-runner/lib/teamcity.js +86 -0
- package/gulp-tasks/modules/gulp-purge.js +88 -0
- package/gulp-tasks/modules/gulp-util.js +5 -0
- package/gulp-tasks/modules/gulp-version.js +8 -0
- package/gulp-tasks/modules/gulp-with-help.js +1 -0
- package/gulp-tasks/modules/gulp-xbuild.js +62 -0
- package/gulp-tasks/modules/gulp.js +92 -0
- package/gulp-tasks/modules/http-downloader.js +113 -0
- package/gulp-tasks/modules/import-npm-tasks.js +33 -0
- package/gulp-tasks/modules/increment-version-string.js +18 -0
- package/gulp-tasks/modules/increment-version.js +30 -0
- package/gulp-tasks/modules/increment-version.ts +41 -0
- package/gulp-tasks/modules/install-local-tools.js +122 -0
- package/gulp-tasks/modules/load-xml-file.js +12 -0
- package/gulp-tasks/modules/load-xml-file.ts +15 -0
- package/gulp-tasks/modules/log-config.js +31 -0
- package/gulp-tasks/modules/log.js +142 -0
- package/gulp-tasks/modules/longest-string-length.js +13 -0
- package/gulp-tasks/modules/looks-like-a-promise.js +11 -0
- package/gulp-tasks/modules/ls-r.js +52 -0
- package/gulp-tasks/modules/multi-split.js +29 -0
- package/gulp-tasks/modules/net-framework-test-assembly-filter.js +45 -0
- package/gulp-tasks/modules/nuget-push.js +66 -0
- package/gulp-tasks/modules/nuget-update-self.js +9 -0
- package/gulp-tasks/modules/nuget.js +8 -0
- package/gulp-tasks/modules/nuget.ts +14 -0
- package/gulp-tasks/modules/pad-left.js +4 -0
- package/gulp-tasks/modules/pad-right.js +4 -0
- package/gulp-tasks/modules/pad.js +25 -0
- package/gulp-tasks/modules/parse-xml-string.js +5 -0
- package/gulp-tasks/modules/parse-xml-string.ts +6 -0
- package/gulp-tasks/modules/parse-xml.js +14 -0
- package/gulp-tasks/modules/parse-xml.ts +15 -0
- package/gulp-tasks/modules/path-unquote.js +6 -0
- package/gulp-tasks/modules/promisify-function.js +19 -0
- package/gulp-tasks/modules/promisify-function.ts +18 -0
- package/gulp-tasks/modules/promisify-stream.js +73 -0
- package/gulp-tasks/modules/promisify.js +1 -0
- package/gulp-tasks/modules/quote-if-required.js +14 -0
- package/gulp-tasks/modules/read-all-git-branches.js +10 -0
- package/gulp-tasks/modules/read-all-git-branches.ts +13 -0
- package/gulp-tasks/modules/read-all-git-remotes.js +36 -0
- package/gulp-tasks/modules/read-all-git-remotes.ts +44 -0
- package/gulp-tasks/modules/read-csproj-package-version.js +16 -0
- package/gulp-tasks/modules/read-csproj-package-version.ts +26 -0
- package/gulp-tasks/modules/read-csproj-version.js +16 -0
- package/gulp-tasks/modules/read-csproj-version.ts +26 -0
- package/gulp-tasks/modules/read-current-git-branch.js +12 -0
- package/gulp-tasks/modules/read-current-git-branch.ts +16 -0
- package/gulp-tasks/modules/read-git-commit-delta-count.js +21 -0
- package/gulp-tasks/modules/read-git-commit-delta-count.ts +33 -0
- package/gulp-tasks/modules/read-git-info.js +28 -0
- package/gulp-tasks/modules/read-git-info.ts +31 -0
- package/gulp-tasks/modules/read-git-remote.js +17 -0
- package/gulp-tasks/modules/read-git-remote.ts +23 -0
- package/gulp-tasks/modules/read-last-fetch-time.js +21 -0
- package/gulp-tasks/modules/read-last-fetch-time.ts +17 -0
- package/gulp-tasks/modules/read-main-branch-name.js +48 -0
- package/gulp-tasks/modules/read-main-branch-name.ts +76 -0
- package/gulp-tasks/modules/read-nuspec-version.js +14 -0
- package/gulp-tasks/modules/read-nuspec-version.ts +22 -0
- package/gulp-tasks/modules/read-package-json.js +16 -0
- package/gulp-tasks/modules/read-package-json.ts +22 -0
- package/gulp-tasks/modules/read-package-version.js +8 -0
- package/gulp-tasks/modules/read-package-version.ts +10 -0
- package/gulp-tasks/modules/read-text-file.js +14 -0
- package/gulp-tasks/modules/read-text-file.ts +14 -0
- package/gulp-tasks/modules/reduce-gulp-noise.js +34 -0
- package/gulp-tasks/modules/register-environment-variables.js +526 -0
- package/gulp-tasks/modules/require-module.js +28 -0
- package/gulp-tasks/modules/resolve-git-branch.js +11 -0
- package/gulp-tasks/modules/resolve-git-branch.ts +13 -0
- package/gulp-tasks/modules/resolve-git-remote.js +11 -0
- package/gulp-tasks/modules/resolve-git-remote.ts +13 -0
- package/gulp-tasks/modules/resolve-masks.js +47 -0
- package/gulp-tasks/modules/resolve-nuget.js +135 -0
- package/gulp-tasks/modules/resolve-test-masks.js +10 -0
- package/gulp-tasks/modules/rewrite-file.js +26 -0
- package/gulp-tasks/modules/rewrite-file.ts +34 -0
- package/gulp-tasks/modules/rimraf.js +21 -0
- package/gulp-tasks/modules/rimraf.ts +31 -0
- package/gulp-tasks/modules/run-sequence.js +16 -0
- package/gulp-tasks/modules/safe-git.js +23 -0
- package/gulp-tasks/modules/safe-git.ts +23 -0
- package/gulp-tasks/modules/seed.js +12 -0
- package/gulp-tasks/modules/set-task-name.js +9 -0
- package/gulp-tasks/modules/sleep.js +5 -0
- package/gulp-tasks/modules/spawn-nuget.js +13 -0
- package/gulp-tasks/modules/spawn.js +103 -0
- package/gulp-tasks/modules/split-path.js +3 -0
- package/gulp-tasks/modules/stat.js +8 -0
- package/gulp-tasks/modules/status.js +57 -0
- package/gulp-tasks/modules/status.ts +71 -0
- package/gulp-tasks/modules/test-path.js +3 -0
- package/gulp-tasks/modules/testutil-finder.js +176 -0
- package/gulp-tasks/modules/throw-if-no-files.js +15 -0
- package/gulp-tasks/modules/uniq.js +6 -0
- package/gulp-tasks/modules/uniq.ts +5 -0
- package/gulp-tasks/modules/verify-exe.js +17 -0
- package/gulp-tasks/modules/version-reading-shared.js +12 -0
- package/gulp-tasks/modules/version-reading-shared.ts +16 -0
- package/gulp-tasks/modules/write-text-file.js +10 -0
- package/gulp-tasks/modules/zarro-error.js +6 -0
- package/gulp-tasks/nuget-restore.js +57 -0
- package/gulp-tasks/pack.js +118 -0
- package/gulp-tasks/purge.js +94 -0
- package/gulp-tasks/release-npm.js +58 -0
- package/gulp-tasks/release-npm.ts +81 -0
- package/gulp-tasks/start/_package.json +39 -0
- package/gulp-tasks/start/gulpfile.js +204 -0
- package/gulp-tasks/start/update-starter-packages.js +63 -0
- package/gulp-tasks/test-dotnet.js +195 -0
- package/gulp-tasks/update-git-submodules.js +11 -0
- package/gulp-tasks/update-git-submodules.ts +29 -0
- package/gulp-tasks/update-self.js +65 -0
- package/gulp-tasks/update-self.ts +88 -0
- package/gulp-tasks/verify-up-to-date.js +77 -0
- package/gulp-tasks/verify-up-to-date.ts +119 -0
- package/index-modules/contains-any.js +31 -0
- package/index-modules/gather-args.js +21 -0
- package/index-modules/handlers/help.js +17 -0
- package/index-modules/handlers/init.js +57 -0
- package/index-modules/handlers/invoke-gulp.js +111 -0
- package/index-modules/handlers/show-env.js +46 -0
- package/index-modules/is-dir.js +6 -0
- package/index-modules/is-file.js +6 -0
- package/index.js +53 -0
- package/package.json +96 -0
- package/tsconfig.json +66 -0
- package/types.d.ts +753 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(function () {
|
|
3
|
+
class Failer {
|
|
4
|
+
constructor(ms, message) {
|
|
5
|
+
this.ms = ms;
|
|
6
|
+
this._cancelled = false;
|
|
7
|
+
this.promise = new Promise((_, reject) => {
|
|
8
|
+
this._timer = setTimeout(() => {
|
|
9
|
+
this._timer = undefined;
|
|
10
|
+
message = message || "operation timed out";
|
|
11
|
+
reject(new Error(message));
|
|
12
|
+
}, ms);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
cancel() {
|
|
16
|
+
if (this._timer) {
|
|
17
|
+
clearTimeout(this._timer);
|
|
18
|
+
this._cancelled = true;
|
|
19
|
+
this._timer = undefined;
|
|
20
|
+
}
|
|
21
|
+
else if (!this._cancelled) {
|
|
22
|
+
// perhaps timer hasn't been set yet
|
|
23
|
+
setImmediate(() => this.cancel());
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
module.exports = function failAfter(ms, message) {
|
|
28
|
+
return new Failer(ms, message);
|
|
29
|
+
};
|
|
30
|
+
})();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Timeout = NodeJS.Timeout;
|
|
2
|
+
|
|
3
|
+
(function() {
|
|
4
|
+
class Failer {
|
|
5
|
+
public promise: Promise<void>;
|
|
6
|
+
|
|
7
|
+
private _timer?: Timeout;
|
|
8
|
+
private _cancelled = false;
|
|
9
|
+
|
|
10
|
+
constructor(public ms: number, message?: string) {
|
|
11
|
+
this.promise = new Promise((_, reject) => {
|
|
12
|
+
this._timer = setTimeout(() => {
|
|
13
|
+
this._timer = undefined;
|
|
14
|
+
message = message || "operation timed out";
|
|
15
|
+
reject(new Error(message));
|
|
16
|
+
}, ms);
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public cancel() {
|
|
21
|
+
if (this._timer) {
|
|
22
|
+
clearTimeout(this._timer);
|
|
23
|
+
this._cancelled = true;
|
|
24
|
+
this._timer = undefined;
|
|
25
|
+
} else if (!this._cancelled) {
|
|
26
|
+
// perhaps timer hasn't been set yet
|
|
27
|
+
setImmediate(() => this.cancel());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
module.exports = function failAfter(ms: number, message?: string) {
|
|
32
|
+
return new Failer(ms, message);
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var fs = require("fs"),
|
|
2
|
+
path = require("path"),
|
|
3
|
+
multiSplit = require("./multi-split");
|
|
4
|
+
|
|
5
|
+
function isDir(p) {
|
|
6
|
+
return fs.existsSync(p) && fs.lstatSync(p).isDirectory();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function pushAll(array, items) {
|
|
10
|
+
Array.prototype.push.apply(array, items);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const cache = {};
|
|
14
|
+
|
|
15
|
+
function findDirs(under, withName, neverTraverse) {
|
|
16
|
+
var result = [];
|
|
17
|
+
neverTraverse = neverTraverse || [];
|
|
18
|
+
|
|
19
|
+
var start = cache[under] || (cache[under] = fs.readdirSync(under));
|
|
20
|
+
var dirs = start.map(d => path.resolve(path.join(under, d))).filter(isDir);
|
|
21
|
+
var toAdd = dirs.filter(d => path.basename(d) === withName);
|
|
22
|
+
var toCheck = dirs
|
|
23
|
+
.filter(d => path.basename(d) !== withName)
|
|
24
|
+
.filter(d => {
|
|
25
|
+
const
|
|
26
|
+
parts = multiSplit(d, [ "/", "\\" ]),
|
|
27
|
+
include = neverTraverse.indexOf(parts[parts.length-1]) === -1;
|
|
28
|
+
return include;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
pushAll(result, toAdd);
|
|
32
|
+
toCheck.forEach(d => {
|
|
33
|
+
result.push.apply(result, findDirs(d, withName, neverTraverse));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = findDirs;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const
|
|
2
|
+
fs = require("fs"),
|
|
3
|
+
path = require("path"),
|
|
4
|
+
resolveNuget = require("./resolve-nuget"),
|
|
5
|
+
pathUnquote = require("./path-unquote"),
|
|
6
|
+
downloadNuget = require("./download-nuget"),
|
|
7
|
+
env = require("./env");
|
|
8
|
+
|
|
9
|
+
let startedDownload = false,
|
|
10
|
+
resolver = null,
|
|
11
|
+
lastResolution = new Promise(function (resolve) {
|
|
12
|
+
resolver = resolve;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function findLocalNuget() {
|
|
16
|
+
const
|
|
17
|
+
targetFolder = env.resolve("BUILD_TOOLS_FOLDER"),
|
|
18
|
+
localNuget = resolveNuget(undefined, false) || path.join(targetFolder, 'nuget.exe');
|
|
19
|
+
return new Promise(function(resolve, reject) {
|
|
20
|
+
if (startedDownload && lastResolution) {
|
|
21
|
+
return resolve(lastResolution);
|
|
22
|
+
}
|
|
23
|
+
if (fs.existsSync(pathUnquote(localNuget))) {
|
|
24
|
+
return resolve(localNuget);
|
|
25
|
+
}
|
|
26
|
+
startedDownload = true;
|
|
27
|
+
downloadNuget(targetFolder).then(function(dl) {
|
|
28
|
+
resolver(dl); // = dl;
|
|
29
|
+
resolve(dl);
|
|
30
|
+
}).catch(function(err) {
|
|
31
|
+
if (fs.existsSync(localNuget)) {
|
|
32
|
+
log.info(err);
|
|
33
|
+
log.info('Falling back on last local nuget.exe');
|
|
34
|
+
lastResolution = localNuget;
|
|
35
|
+
return resolve(localNuget);
|
|
36
|
+
}
|
|
37
|
+
reject(err);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
module.exports = findLocalNuget;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const
|
|
2
|
+
{ ZarroError } = requireModule("zarro-error"),
|
|
3
|
+
path = require("path"),
|
|
4
|
+
fs = requireModule("fs");
|
|
5
|
+
let cached;
|
|
6
|
+
|
|
7
|
+
function findClosestPackageJsonFolder() {
|
|
8
|
+
let current = __dirname;
|
|
9
|
+
while (inNodeModulesFolder(current) || !hasPackageJson(current)) {
|
|
10
|
+
const next = path.dirname(current);
|
|
11
|
+
if (next === current) {
|
|
12
|
+
throw new ZarroError(`Can't find a package.json, traversing up from ${__dirname}`);
|
|
13
|
+
}
|
|
14
|
+
current = next;
|
|
15
|
+
}
|
|
16
|
+
return current;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function inNodeModulesFolder(folder) {
|
|
20
|
+
return !!folder.match(/node_modules/);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function hasPackageJson(folder) {
|
|
24
|
+
const test = path.join(folder, "package.json");
|
|
25
|
+
if (!fs.existsSync(test)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const
|
|
30
|
+
contents = require(test),
|
|
31
|
+
repo = contents.repository || {},
|
|
32
|
+
url = repo.url || "",
|
|
33
|
+
isGulpTasks = url.match(/\/fluffynuts\/gulp-tasks$/);
|
|
34
|
+
return !isGulpTasks;
|
|
35
|
+
} catch (ignore) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = function() {
|
|
41
|
+
return cached || (cached = findClosestPackageJsonFolder());
|
|
42
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const
|
|
2
|
+
{ ZarroError } = requireModule("zarro-error"),
|
|
3
|
+
promisify = require("./promisify-function"),
|
|
4
|
+
path = require("path"),
|
|
5
|
+
fs = require("fs");
|
|
6
|
+
|
|
7
|
+
const
|
|
8
|
+
stat = promisify(fs.stat, fs),
|
|
9
|
+
readFile = promisify(fs.readFile, fs),
|
|
10
|
+
readdir = promisify(fs.readdir, fs),
|
|
11
|
+
mkdir = promisify(fs.mkdir, fs),
|
|
12
|
+
exists = promisify(fs.exists, fs, true);
|
|
13
|
+
|
|
14
|
+
function isFile(p) {
|
|
15
|
+
return runStat(p, st => st.isFile());
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function isFolder(p) {
|
|
19
|
+
return runStat(p, st => st.isDirectory());
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function runStat(p, fn) {
|
|
23
|
+
return new Promise(resolve => {
|
|
24
|
+
fs.stat(p, (err, st) => {
|
|
25
|
+
if (err) {
|
|
26
|
+
return resolve(false);
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
resolve(st && fn(st));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
resolve(false);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const exported = {
|
|
38
|
+
...fs.promises, // if they exist
|
|
39
|
+
stat,
|
|
40
|
+
readFile,
|
|
41
|
+
readdir,
|
|
42
|
+
mkdir,
|
|
43
|
+
exists,
|
|
44
|
+
isFile,
|
|
45
|
+
isFolder,
|
|
46
|
+
fileExists: isFile,
|
|
47
|
+
folderExists: isFolder,
|
|
48
|
+
|
|
49
|
+
ensureDirectoryExists: async function(expectedPath) {
|
|
50
|
+
// forward-slashes can be valid (and mixed) on win32,
|
|
51
|
+
// so split on both \ and / to make \o/
|
|
52
|
+
const
|
|
53
|
+
parts = expectedPath.split(/\\|\//),
|
|
54
|
+
current = [];
|
|
55
|
+
for (const part of parts) {
|
|
56
|
+
if (!part) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
current.push(part);
|
|
60
|
+
const
|
|
61
|
+
test = current.join(path.sep),
|
|
62
|
+
pathExists = await exists(test);
|
|
63
|
+
if (pathExists) {
|
|
64
|
+
const st = await stat(test);
|
|
65
|
+
if (!st.isDirectory()) {
|
|
66
|
+
throw new ZarroError(`${test} exists but is not a directory`);
|
|
67
|
+
}
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
await mkdir(test);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
Object.keys(fs)
|
|
76
|
+
.filter(k => k.match(/Sync$/) && typeof fs[k] === "function")
|
|
77
|
+
.forEach(k => exported[k] = fs[k].bind(fs));
|
|
78
|
+
|
|
79
|
+
module.exports = exported;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
(function () {
|
|
4
|
+
// resolves the file paths found by a globbing gulp.src
|
|
5
|
+
const collectFiles = require("./collect-files"), promisifyStream = require("./promisify-stream"), gulp = require("./gulp");
|
|
6
|
+
module.exports = async function (pathSpecs) {
|
|
7
|
+
return new Promise(async (resolve, reject) => {
|
|
8
|
+
try {
|
|
9
|
+
if (!Array.isArray(pathSpecs)) {
|
|
10
|
+
pathSpecs = [pathSpecs];
|
|
11
|
+
}
|
|
12
|
+
const target = [];
|
|
13
|
+
await promisifyStream(gulp.src(pathSpecs)
|
|
14
|
+
.pipe(collectFiles(target)));
|
|
15
|
+
resolve(target.map(f => f.path));
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
reject(e);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
module.exports;
|
|
23
|
+
})();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as vinyl from "vinyl";
|
|
2
|
+
|
|
3
|
+
(function() {
|
|
4
|
+
// resolves the file paths found by a globbing gulp.src
|
|
5
|
+
const
|
|
6
|
+
collectFiles = require("./collect-files"),
|
|
7
|
+
promisifyStream = require("./promisify-stream"),
|
|
8
|
+
gulp = require("./gulp");
|
|
9
|
+
|
|
10
|
+
module.exports = async function(pathSpecs: string | string[]) {
|
|
11
|
+
return new Promise(async (resolve, reject) => {
|
|
12
|
+
try {
|
|
13
|
+
if (!Array.isArray(pathSpecs)) {
|
|
14
|
+
pathSpecs = [pathSpecs];
|
|
15
|
+
}
|
|
16
|
+
const target = [] as vinyl.BufferFile[];
|
|
17
|
+
await promisifyStream(
|
|
18
|
+
gulp.src(pathSpecs)
|
|
19
|
+
.pipe(collectFiles(target))
|
|
20
|
+
);
|
|
21
|
+
resolve(target.map(f => f.path));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports;
|
|
29
|
+
})();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const
|
|
2
|
+
fallback = require("./fallback"),
|
|
3
|
+
padRight = require("./pad-right");
|
|
4
|
+
|
|
5
|
+
function makeHelpString(stringOrObject) {
|
|
6
|
+
if (typeof(stringOrObject === "string")) {
|
|
7
|
+
return stringOrObject;
|
|
8
|
+
}
|
|
9
|
+
let msg, defaultValue;
|
|
10
|
+
if (Array.isArray(stringOrObject)) {
|
|
11
|
+
msg = stringOrObject[0];
|
|
12
|
+
defaultValue = stringOrObject[1];
|
|
13
|
+
} else {
|
|
14
|
+
msg = fallback(stringOrObject.message, stringOrObject.msg);
|
|
15
|
+
defaultValue = fallback(stringOrObject.defaultValue, stringOrObject.default);
|
|
16
|
+
}
|
|
17
|
+
return `${msg} (default: ${defaultValue})`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = function generateEnvHelpFor(dict) {
|
|
21
|
+
const
|
|
22
|
+
keys = Object.keys(dict),
|
|
23
|
+
longest = keys.reduce((acc, cur) => cur.length > acc ? cur.length : acc);
|
|
24
|
+
|
|
25
|
+
return [
|
|
26
|
+
"\tObserved environment variables:"
|
|
27
|
+
].concat(Object.keys(dict).map(k =>
|
|
28
|
+
`${padRight(k, longest)} ${makeHelpString(dict[k])}`
|
|
29
|
+
)).join("\n\t\t");
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
let env;
|
|
2
|
+
const debug = require("debug")("get-tools-folder");
|
|
3
|
+
function getToolsFolder(overrideEnv) {
|
|
4
|
+
if (!overrideEnv) {
|
|
5
|
+
env = env || require("./env");
|
|
6
|
+
}
|
|
7
|
+
var result = (overrideEnv || env).resolve("BUILD_TOOLS_FOLDER");
|
|
8
|
+
debug("-> getting tools from: ", result);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = getToolsFolder;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(function () {
|
|
3
|
+
const Git = require("simple-git/promise"), gutil = requireModule("gulp-util"), resolveGitRemote = requireModule("resolve-git-remote");
|
|
4
|
+
async function gitPushTags(dryRun, where) {
|
|
5
|
+
if (dryRun === undefined) {
|
|
6
|
+
dryRun = {};
|
|
7
|
+
}
|
|
8
|
+
let quiet = false;
|
|
9
|
+
if (typeof dryRun === "object") {
|
|
10
|
+
where = dryRun.where || ".";
|
|
11
|
+
quiet = dryRun.quiet || false;
|
|
12
|
+
dryRun = dryRun.dryRun || false;
|
|
13
|
+
}
|
|
14
|
+
else if (where !== undefined) {
|
|
15
|
+
gutil.log.warn(gutil.colors.red("depreciation warning: options for git-push-tags should be sent via an object"));
|
|
16
|
+
}
|
|
17
|
+
where = where || ".";
|
|
18
|
+
const git = new Git(where), more = where && where !== "." ? ` (${where})` : "";
|
|
19
|
+
if (dryRun) {
|
|
20
|
+
if (!quiet) {
|
|
21
|
+
gutil.log(gutil.colors.green(`dry run: should push tags now${more}...`));
|
|
22
|
+
}
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const remote = await resolveGitRemote();
|
|
26
|
+
if (!remote) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
gutil.log(gutil.colors.green(`pushing tags${more}...`));
|
|
30
|
+
await git.pushTags(remote);
|
|
31
|
+
}
|
|
32
|
+
module.exports = gitPushTags;
|
|
33
|
+
})();
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
const
|
|
3
|
+
Git = require("simple-git/promise"),
|
|
4
|
+
gutil = requireModule<GulpUtil>("gulp-util"),
|
|
5
|
+
resolveGitRemote = requireModule<ResolveGitRemote>("resolve-git-remote");
|
|
6
|
+
|
|
7
|
+
async function gitPushTags(dryRun?: boolean | GitPushOptions, where?: string): Promise<void> {
|
|
8
|
+
if (dryRun === undefined) {
|
|
9
|
+
dryRun = {};
|
|
10
|
+
}
|
|
11
|
+
let quiet = false;
|
|
12
|
+
if (typeof dryRun === "object") {
|
|
13
|
+
where = dryRun.where || ".";
|
|
14
|
+
quiet = dryRun.quiet || false;
|
|
15
|
+
dryRun = dryRun.dryRun || false;
|
|
16
|
+
} else if (where !== undefined) {
|
|
17
|
+
gutil.log.warn(
|
|
18
|
+
gutil.colors.red(
|
|
19
|
+
"depreciation warning: options for git-push-tags should be sent via an object"
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
where = where || ".";
|
|
24
|
+
const
|
|
25
|
+
git = new Git(where),
|
|
26
|
+
more = where && where !== "." ? ` (${ where })` : ""
|
|
27
|
+
if (dryRun) {
|
|
28
|
+
if (!quiet) {
|
|
29
|
+
gutil.log(gutil.colors.green(`dry run: should push tags now${ more }...`));
|
|
30
|
+
}
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const remote = await resolveGitRemote();
|
|
34
|
+
if (!remote) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
gutil.log(gutil.colors.green(`pushing tags${ more }...`));
|
|
38
|
+
await git.pushTags(remote);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = gitPushTags;
|
|
42
|
+
})();
|