@arcadible/github-release-tools 0.1.5 → 0.1.7
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/bin/arctool-build.sh +3 -11
- package/bin/arctool-put-build.sh +6 -0
- package/bin/arctool-put-cache.sh +6 -0
- package/package.json +3 -2
- package/src/assert-tag.js +4 -1
- package/src/build.js +35 -0
- package/src/{put-skip-build.js → put-build.js} +1 -1
- package/src/put-cache.js +52 -0
- package/src/put-prerelease.js +4 -1
- package/src/put-version.js +4 -1
- package/bin/arctool-put-skip-build.sh +0 -6
package/bin/arctool-build.sh
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -e
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
echo "Unable to find ${JSON##*/}: $JSON"
|
|
7
|
-
exit 1
|
|
8
|
-
else
|
|
9
|
-
npm --prefix "$PACKAGE" ci --silent
|
|
10
|
-
fi
|
|
11
|
-
if jq -e '.scripts.build' "$JSON" >/dev/null 2>&1; then
|
|
12
|
-
npm --prefix "$PACKAGE" run build --silent
|
|
13
|
-
fi
|
|
3
|
+
SCRIPT="$(realpath "$0")"
|
|
4
|
+
DIR="$(dirname "$SCRIPT")"
|
|
5
|
+
node "$DIR/../src/build.js" "$1"
|
package/package.json
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"arctool-assert-dir": "bin/arctool-assert-dir.sh",
|
|
4
4
|
"arctool-assert-tag": "bin/arctool-assert-tag.sh",
|
|
5
5
|
"arctool-build": "bin/arctool-build.sh",
|
|
6
|
+
"arctool-put-build": "bin/arctool-put-build.sh",
|
|
7
|
+
"arctool-put-cache": "bin/arctool-put-cache.sh",
|
|
6
8
|
"arctool-put-deploy-dir": "bin/arctool-put-deploy-dir.sh",
|
|
7
9
|
"arctool-put-prerelease": "bin/arctool-put-prerelease.sh",
|
|
8
|
-
"arctool-put-skip-build": "bin/arctool-put-skip-build.sh",
|
|
9
10
|
"arctool-put-version": "bin/arctool-put-version.sh"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
@@ -17,5 +18,5 @@
|
|
|
17
18
|
},
|
|
18
19
|
"license": "Apache-2.0",
|
|
19
20
|
"name": "@arcadible/github-release-tools",
|
|
20
|
-
"version": "0.1.
|
|
21
|
+
"version": "0.1.7"
|
|
21
22
|
}
|
package/src/assert-tag.js
CHANGED
package/src/build.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// [import]
|
|
4
|
+
|
|
5
|
+
const cp = require("node:child_process");
|
|
6
|
+
|
|
7
|
+
// [use]
|
|
8
|
+
|
|
9
|
+
const execSync = cp.execSync; // eslint-disable-line no-sync
|
|
10
|
+
|
|
11
|
+
// [define]
|
|
12
|
+
|
|
13
|
+
const command = process.argv[2];
|
|
14
|
+
|
|
15
|
+
// [function]
|
|
16
|
+
|
|
17
|
+
const writeErr = function (data) {
|
|
18
|
+
process.stderr.write(data.trim().concat("\n"));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// [main]
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
if (!command) {
|
|
25
|
+
throw new Error("No command provided.");
|
|
26
|
+
}
|
|
27
|
+
execSync(command, {
|
|
28
|
+
cwd: process.cwd(),
|
|
29
|
+
shell: "/bin/bash",
|
|
30
|
+
stdio: "inherit",
|
|
31
|
+
});
|
|
32
|
+
} catch (ex) {
|
|
33
|
+
writeErr(ex.message);
|
|
34
|
+
process.exit(ex.status || 1);
|
|
35
|
+
}
|
package/src/put-cache.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// [import]
|
|
4
|
+
|
|
5
|
+
const fs = require("node:fs");
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
// [use]
|
|
9
|
+
|
|
10
|
+
const dirname = path.dirname;
|
|
11
|
+
const existsSync = fs.existsSync; // eslint-disable-line no-sync
|
|
12
|
+
const join = path.join;
|
|
13
|
+
|
|
14
|
+
// [define]
|
|
15
|
+
|
|
16
|
+
const file = process.argv[2];
|
|
17
|
+
|
|
18
|
+
// [function]
|
|
19
|
+
|
|
20
|
+
const write = function (data) {
|
|
21
|
+
process.stdout.write(data.trim().concat("\n"));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// [function]
|
|
25
|
+
|
|
26
|
+
const writeErr = function (data) {
|
|
27
|
+
process.stderr.write(data.trim().concat("\n"));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// [main]
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
if (!file) {
|
|
34
|
+
throw new Error("No file provided.");
|
|
35
|
+
}
|
|
36
|
+
const root = dirname(file);
|
|
37
|
+
if (
|
|
38
|
+
existsSync(join(root, "package-lock.json")) ||
|
|
39
|
+
existsSync(join(root, "npm-shrinkwrap.json"))
|
|
40
|
+
) {
|
|
41
|
+
write("npm");
|
|
42
|
+
} else if (existsSync(join(root, "pnpm-lock.yaml"))) {
|
|
43
|
+
write("pnpm");
|
|
44
|
+
} else if (existsSync(join(root, "yarn.lock"))) {
|
|
45
|
+
write("yarn");
|
|
46
|
+
} else {
|
|
47
|
+
write("");
|
|
48
|
+
}
|
|
49
|
+
} catch (ex) {
|
|
50
|
+
writeErr(ex.message);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
package/src/put-prerelease.js
CHANGED
package/src/put-version.js
CHANGED