oclif 1.18.2-dev.3 → 1.18.3
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/.oclif.manifest.json +1 -1
- package/CHANGELOG.md +30 -9
- package/README.md +6 -6
- package/lib/app-command.d.ts +1 -5
- package/lib/command-base.d.ts +1 -1
- package/lib/commands/command.d.ts +2 -4
- package/lib/commands/hook.d.ts +1 -5
- package/lib/commands/pack/deb.js +4 -4
- package/lib/commands/pack/macos.d.ts +0 -1
- package/lib/commands/pack/macos.js +8 -15
- package/lib/commands/pack/tarballs.d.ts +1 -5
- package/lib/commands/pack/win.d.ts +0 -1
- package/lib/commands/pack/win.js +11 -17
- package/lib/commands/promote.d.ts +1 -13
- package/lib/commands/readme.d.ts +1 -4
- package/lib/commands/readme.js +8 -8
- package/lib/commands/upload/deb.js +3 -3
- package/lib/commands/upload/macos.js +4 -4
- package/lib/commands/upload/tarballs.d.ts +1 -5
- package/lib/commands/upload/tarballs.js +9 -11
- package/lib/commands/upload/win.js +6 -6
- package/lib/generators/app.js +104 -115
- package/lib/log.js +1 -1
- package/lib/tarballs/bin.js +1 -1
- package/lib/tarballs/build.js +20 -20
- package/lib/util.js +22 -22
- package/lib/version-indexes.js +4 -4
- package/package.json +22 -23
- package/templates/eslintrc +5 -1
- package/templates/eslintrc.typescript +4 -6
- package/templates/tsconfig.json +2 -1
package/.oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.18.
|
|
1
|
+
{"version":"1.18.3","commands":{"base":{"id":"base","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"options":{"name":"options","type":"option","description":"(yarn|typescript|eslint|mocha)"},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"path","description":"path to project, defaults to current directory","required":false}]},"command":{"id":"command","description":"add a command to an existing CLI or plugin","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"name","description":"name of command","required":true}]},"hook":{"id":"hook","description":"add a hook to an existing CLI or plugin","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false},"event":{"name":"event","type":"option","description":"event to run hook on","default":"init"}},"args":[{"name":"name","description":"name of hook (snake_case)","required":true}]},"manifest":{"id":"manifest","description":"generates plugin manifest json","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin","default":"."}]},"multi":{"id":"multi","description":"generate a new multi-command CLI","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"options":{"name":"options","type":"option","description":"(yarn|typescript|eslint|mocha)"},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"path","description":"path to project, defaults to current directory","required":false}]},"plugin":{"id":"plugin","description":"create a new CLI plugin","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"options":{"name":"options","type":"option","description":"(yarn|typescript|eslint|mocha)"},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"path","description":"path to project, defaults to current directory","required":false}]},"promote":{"id":"promote","description":"promote CLI builds to a S3 release channel","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to the oclif CLI project root","required":true,"default":"."},"version":{"name":"version","type":"option","description":"semantic version of the CLI to promote","required":true},"sha":{"name":"sha","type":"option","description":"7-digit short git commit SHA of the CLI to promote","required":true},"channel":{"name":"channel","type":"option","description":"which channel to promote to","required":true,"default":"stable"},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to promote (e.g.: linux-arm,win32-x64)","default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64"},"deb":{"name":"deb","type":"boolean","char":"d","description":"promote debian artifacts","allowNo":false},"macos":{"name":"macos","type":"boolean","char":"m","description":"promote macOS pkg","allowNo":false},"win":{"name":"win","type":"boolean","char":"w","description":"promote Windows exe","allowNo":false},"max-age":{"name":"max-age","type":"option","char":"a","description":"cache control max-age in seconds","default":"86400"},"xz":{"name":"xz","type":"boolean","description":"also upload xz","allowNo":true},"indexes":{"name":"indexes","type":"boolean","description":"append the promoted urls into the index files","allowNo":false}},"args":[]},"readme":{"id":"readme","description":"adds commands to README.md in current directory\nThe readme must have any of the following tags inside of it for it to be replaced or else it will do nothing:\n# Usage\n<!-- usage -->\n# Commands\n<!-- commands -->\n\nCustomize the code URL prefix by setting oclif.repositoryPrefix in package.json.\n","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"dir":{"name":"dir","type":"option","description":"output directory for multi docs","required":true,"default":"docs"},"multi":{"name":"multi","type":"boolean","description":"create a different markdown page for each topic","allowNo":false}},"args":[]},"single":{"id":"single","description":"generate a new single-command CLI","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"options":{"name":"options","type":"option","description":"(yarn|typescript|eslint|mocha)"},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"path","description":"path to project, defaults to current directory","required":false}]},"pack:deb":{"id":"pack:deb","description":"pack CLI into debian package","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]},"pack:macos":{"id":"pack:macos","description":"pack CLI into macOS .pkg","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]},"pack:tarballs":{"id":"pack:tarballs","description":"packages oclif CLI into tarballs\n\nThis can be used to create oclif CLIs that use the system node or that come preloaded with a node binary.\n","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to pack (e.g.: linux-arm,win32-x64)","default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64"},"xz":{"name":"xz","type":"boolean","description":"also build xz","allowNo":true}},"args":[]},"pack:win":{"id":"pack:win","description":"create windows installer from oclif CLI","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]},"upload:deb":{"id":"upload:deb","description":"upload deb package built with pack:deb","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]},"upload:macos":{"id":"upload:macos","description":"upload macos installers built with pack:macos","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]},"upload:tarballs":{"id":"upload:tarballs","description":"upload an oclif CLI to S3\n\n\"aws-sdk\" will need to be installed as a devDependency to upload.\n","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to upload (e.g.: linux-arm,win32-x64)","default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64"},"xz":{"name":"xz","type":"boolean","description":"also upload xz","allowNo":true}},"args":[]},"upload:win":{"id":"upload:win","description":"upload windows installers built with pack:win","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]}}}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,26 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.18.
|
|
5
|
+
### [1.18.3](https://github.com/oclif/oclif/compare/v1.18.2...v1.18.3) (2021-12-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* bump deps ([#746](https://github.com/oclif/oclif/issues/746)) ([dc1b60a](https://github.com/oclif/oclif/commit/dc1b60af7b9e973464ca19e22cd902be26b5353b))
|
|
11
|
+
|
|
12
|
+
### [1.18.2](https://github.com/oclif/oclif/compare/v2.0.0...v1.18.2) (2021-12-01)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* force 1.18.2 ([40c9d20](https://github.com/oclif/oclif/commit/40c9d20c93f92f1ebdecb671ed6d0c92f10d37f0))
|
|
18
|
+
* force release at 1.8.2 ([c8a1077](https://github.com/oclif/oclif/commit/c8a10774d9cd933e04bc70d23f5d8587f4fbb3d9))
|
|
19
|
+
|
|
20
|
+
## [2.0.0](https://github.com/oclif/oclif/compare/v1.18.1...v2.0.0) (2021-12-01)
|
|
6
21
|
|
|
7
22
|
|
|
8
23
|
### ⚠ BREAKING CHANGES
|
|
9
24
|
|
|
10
25
|
* require node 12+ (#676)
|
|
11
26
|
|
|
12
|
-
###
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* bump deps ([#723](https://github.com/oclif/oclif/issues/723)) ([78640ad](https://github.com/oclif/oclif/commit/78640adb106350e1abe747559dc0ae65c853d7c8))
|
|
30
|
+
|
|
13
31
|
|
|
14
|
-
|
|
15
|
-
|
|
32
|
+
### build
|
|
33
|
+
|
|
34
|
+
* require node 12+ ([#676](https://github.com/oclif/oclif/issues/676)) ([f4b648c](https://github.com/oclif/oclif/commit/f4b648c244c8806c999ad2e636c446414b14c5a5))
|
|
16
35
|
|
|
36
|
+
## [2.0.0-master.0](https://github.com/oclif/oclif/compare/v1.18.1...v2.0.0-master.0) (2021-12-01)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### ⚠ BREAKING CHANGES
|
|
40
|
+
|
|
41
|
+
* require node 12+ (#676)
|
|
17
42
|
|
|
18
43
|
### Bug Fixes
|
|
19
44
|
|
|
20
|
-
*
|
|
21
|
-
* lint ([110e659](https://github.com/oclif/oclif/commit/110e6597c3fe41a1453c0034b166b23419324b71))
|
|
22
|
-
* release new dev version ([cb63e9c](https://github.com/oclif/oclif/commit/cb63e9c508dbbf7dea0ed44a3bd082be7fbc122b))
|
|
23
|
-
* tests ([7a68684](https://github.com/oclif/oclif/commit/7a68684cd25ba4b770d16904fc22eb266c0c4b1f))
|
|
24
|
-
* upload tarballs using same version as they were built with ([ec61f18](https://github.com/oclif/oclif/commit/ec61f18b83987bbd0bf7c4dc583e3e891e3a29d3))
|
|
45
|
+
* bump deps ([#723](https://github.com/oclif/oclif/issues/723)) ([78640ad](https://github.com/oclif/oclif/commit/78640adb106350e1abe747559dc0ae65c853d7c8))
|
|
25
46
|
|
|
26
47
|
|
|
27
48
|
### build
|
package/README.md
CHANGED
|
@@ -146,7 +146,7 @@ OPTIONS
|
|
|
146
146
|
--force overwrite existing files
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
_See code: [src/commands/command.ts](https://github.com/oclif/oclif/blob/v1.18.2
|
|
149
|
+
_See code: [src/commands/command.ts](https://github.com/oclif/oclif/blob/v1.18.2/src/commands/command.ts)_
|
|
150
150
|
|
|
151
151
|
## `oclif help [COMMAND]`
|
|
152
152
|
|
|
@@ -163,7 +163,7 @@ OPTIONS
|
|
|
163
163
|
--all see all commands in CLI
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.
|
|
166
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.14/src/commands/help.ts)_
|
|
167
167
|
|
|
168
168
|
## `oclif hook NAME`
|
|
169
169
|
|
|
@@ -182,7 +182,7 @@ OPTIONS
|
|
|
182
182
|
--force overwrite existing files
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
_See code: [src/commands/hook.ts](https://github.com/oclif/oclif/blob/v1.18.2
|
|
185
|
+
_See code: [src/commands/hook.ts](https://github.com/oclif/oclif/blob/v1.18.2/src/commands/hook.ts)_
|
|
186
186
|
|
|
187
187
|
## `oclif multi [PATH]`
|
|
188
188
|
|
|
@@ -201,7 +201,7 @@ OPTIONS
|
|
|
201
201
|
--options=options (yarn|typescript|eslint|mocha)
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
-
_See code: [src/commands/multi.ts](https://github.com/oclif/oclif/blob/v1.18.2
|
|
204
|
+
_See code: [src/commands/multi.ts](https://github.com/oclif/oclif/blob/v1.18.2/src/commands/multi.ts)_
|
|
205
205
|
|
|
206
206
|
## `oclif plugin [PATH]`
|
|
207
207
|
|
|
@@ -220,7 +220,7 @@ OPTIONS
|
|
|
220
220
|
--options=options (yarn|typescript|eslint|mocha)
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
_See code: [src/commands/plugin.ts](https://github.com/oclif/oclif/blob/v1.18.2
|
|
223
|
+
_See code: [src/commands/plugin.ts](https://github.com/oclif/oclif/blob/v1.18.2/src/commands/plugin.ts)_
|
|
224
224
|
|
|
225
225
|
## `oclif single [PATH]`
|
|
226
226
|
|
|
@@ -239,7 +239,7 @@ OPTIONS
|
|
|
239
239
|
--options=options (yarn|typescript|eslint|mocha)
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
-
_See code: [src/commands/single.ts](https://github.com/oclif/oclif/blob/v1.18.2
|
|
242
|
+
_See code: [src/commands/single.ts](https://github.com/oclif/oclif/blob/v1.18.2/src/commands/single.ts)_
|
|
243
243
|
<!-- commandsstop -->
|
|
244
244
|
|
|
245
245
|
# 🏭 Related Repositories
|
package/lib/app-command.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { flags } from '@oclif/command';
|
|
2
2
|
import Base from './command-base';
|
|
3
3
|
export default abstract class AppCommand extends Base {
|
|
4
|
-
static flags:
|
|
5
|
-
defaults: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
6
|
-
options: flags.IOptionFlag<string | undefined>;
|
|
7
|
-
force: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
8
|
-
};
|
|
4
|
+
static flags: flags.Input<any>;
|
|
9
5
|
static args: {
|
|
10
6
|
name: string;
|
|
11
7
|
required: boolean;
|
package/lib/command-base.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { flags } from '@oclif/command';
|
|
1
2
|
import Base from '../command-base';
|
|
2
3
|
export interface Options {
|
|
3
4
|
name: string;
|
|
@@ -6,10 +7,7 @@ export interface Options {
|
|
|
6
7
|
}
|
|
7
8
|
export default abstract class AppCommand extends Base {
|
|
8
9
|
static description: string;
|
|
9
|
-
static flags:
|
|
10
|
-
defaults: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
11
|
-
force: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
12
|
-
};
|
|
10
|
+
static flags: flags.Input<any>;
|
|
13
11
|
static args: {
|
|
14
12
|
name: string;
|
|
15
13
|
description: string;
|
package/lib/commands/hook.d.ts
CHANGED
|
@@ -8,11 +8,7 @@ export interface Options {
|
|
|
8
8
|
}
|
|
9
9
|
export default abstract class HookCommand extends Base {
|
|
10
10
|
static description: string;
|
|
11
|
-
static flags:
|
|
12
|
-
defaults: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
13
|
-
force: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
14
|
-
event: flags.IOptionFlag<string>;
|
|
15
|
-
};
|
|
11
|
+
static flags: flags.Input<any>;
|
|
16
12
|
static args: {
|
|
17
13
|
name: string;
|
|
18
14
|
description: string;
|
package/lib/commands/pack/deb.js
CHANGED
|
@@ -47,14 +47,14 @@ class PackDeb extends command_1.Command {
|
|
|
47
47
|
throw new Error('debian packing must be run on linux');
|
|
48
48
|
const { flags } = this.parse(PackDeb);
|
|
49
49
|
const buildConfig = await Tarballs.buildConfig(flags.root);
|
|
50
|
-
const { config } = buildConfig;
|
|
50
|
+
const { config, tmp, targets } = buildConfig;
|
|
51
51
|
await Tarballs.build(buildConfig, { platform: 'linux', pack: false });
|
|
52
52
|
const dist = buildConfig.dist('deb');
|
|
53
53
|
await qq.emptyDir(dist);
|
|
54
54
|
const build = async (arch) => {
|
|
55
55
|
const target = { platform: 'linux', arch };
|
|
56
56
|
const versionedDebBase = upload_util_1.templateShortKey('deb', { bin: config.bin, versionShaRevision: upload_util_1.debVersion(buildConfig), arch: upload_util_1.debArch(arch) });
|
|
57
|
-
const workspace = qq.join(
|
|
57
|
+
const workspace = qq.join(tmp, 'apt', versionedDebBase.replace('.deb', '.apt'));
|
|
58
58
|
await qq.rm(workspace);
|
|
59
59
|
await qq.mkdirp([workspace, 'DEBIAN']);
|
|
60
60
|
await qq.mkdirp([workspace, 'usr/bin']);
|
|
@@ -68,7 +68,7 @@ class PackDeb extends command_1.Command {
|
|
|
68
68
|
await qq.x(`chgrp -R root "${workspace}"`);
|
|
69
69
|
await qq.x(`dpkg --build "${workspace}" "${qq.join(dist, versionedDebBase)}"`);
|
|
70
70
|
};
|
|
71
|
-
const arches = _.uniq(
|
|
71
|
+
const arches = _.uniq(targets
|
|
72
72
|
.filter(t => t.platform === 'linux')
|
|
73
73
|
.map(t => t.arch));
|
|
74
74
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -78,7 +78,7 @@ class PackDeb extends command_1.Command {
|
|
|
78
78
|
await qq.x('gzip -c Packages > Packages.gz', { cwd: dist });
|
|
79
79
|
await qq.x('bzip2 -k Packages', { cwd: dist });
|
|
80
80
|
await qq.x('xz -k Packages', { cwd: dist });
|
|
81
|
-
const ftparchive = qq.join(
|
|
81
|
+
const ftparchive = qq.join(tmp, 'apt', 'apt-ftparchive.conf');
|
|
82
82
|
await qq.write(ftparchive, scripts.ftparchive(config));
|
|
83
83
|
await qq.x(`apt-ftparchive -c "${ftparchive}" release . > Release`, { cwd: dist });
|
|
84
84
|
const gpgKey = config.scopedEnvVar('DEB_KEY');
|
|
@@ -6,21 +6,17 @@ const qq = require("qqjs");
|
|
|
6
6
|
const Tarballs = require("../../tarballs");
|
|
7
7
|
const upload_util_1 = require("../../upload-util");
|
|
8
8
|
const scripts = {
|
|
9
|
-
preinstall: (config
|
|
9
|
+
preinstall: (config) => `#!/usr/bin/env bash
|
|
10
10
|
sudo rm -rf /usr/local/lib/${config.dirname}
|
|
11
11
|
sudo rm -rf /usr/local/${config.bin}
|
|
12
12
|
sudo rm -rf /usr/local/bin/${config.bin}
|
|
13
|
-
${additionalExecutable ?
|
|
14
|
-
`sudo rm -rf /usr/local/${additionalExecutable}
|
|
15
|
-
sudo rm -rf /usr/local/bin/${additionalExecutable}` : ''}
|
|
16
13
|
`,
|
|
17
|
-
postinstall: (config
|
|
14
|
+
postinstall: (config) => `#!/usr/bin/env bash
|
|
18
15
|
set -x
|
|
19
16
|
sudo mkdir -p /usr/local/bin
|
|
20
17
|
sudo ln -sf /usr/local/lib/${config.dirname}/bin/${config.bin} /usr/local/bin/${config.bin}
|
|
21
|
-
${additionalExecutable ? `sudo ln -sf /usr/local/lib/${config.dirname}/bin/${additionalExecutable} /usr/local/bin/${additionalExecutable}` : ''}
|
|
22
18
|
`,
|
|
23
|
-
uninstall: (config
|
|
19
|
+
uninstall: (config) => {
|
|
24
20
|
const packageIdentifier = config.pjson.oclif.macos.identifier;
|
|
25
21
|
return `#!/usr/bin/env bash
|
|
26
22
|
|
|
@@ -61,7 +57,6 @@ done
|
|
|
61
57
|
echo "Application uninstalling process started"
|
|
62
58
|
# remove link to shorcut file
|
|
63
59
|
find "/usr/local/bin/" -name "${config.bin}" | xargs rm
|
|
64
|
-
${additionalExecutable ? `find "/usr/local/bin/" -name "${additionalExecutable}" | xargs rm` : ''}
|
|
65
60
|
if [ $? -eq 0 ]
|
|
66
61
|
then
|
|
67
62
|
echo "[1/3] [DONE] Successfully deleted shortcut links"
|
|
@@ -98,7 +93,7 @@ class PackMacos extends command_1.Command {
|
|
|
98
93
|
this.error('must be run from macos');
|
|
99
94
|
const { flags } = this.parse(PackMacos);
|
|
100
95
|
const buildConfig = await Tarballs.buildConfig(flags.root);
|
|
101
|
-
const { config } = buildConfig;
|
|
96
|
+
const { config, tmp, gitSha, version } = buildConfig;
|
|
102
97
|
const c = config.pjson.oclif;
|
|
103
98
|
if (!c.macos)
|
|
104
99
|
this.error('package.json is missing an oclif.macos config');
|
|
@@ -107,15 +102,15 @@ class PackMacos extends command_1.Command {
|
|
|
107
102
|
const macos = c.macos;
|
|
108
103
|
const packageIdentifier = macos.identifier;
|
|
109
104
|
await Tarballs.build(buildConfig, { platform: 'darwin', pack: false });
|
|
110
|
-
const templateKey = upload_util_1.templateShortKey('macos', { bin: config.bin, version: config.version, sha:
|
|
105
|
+
const templateKey = upload_util_1.templateShortKey('macos', { bin: config.bin, version: config.version, sha: gitSha });
|
|
111
106
|
const dist = buildConfig.dist(`macos/${templateKey}`);
|
|
112
107
|
await qq.emptyDir(path.dirname(dist));
|
|
113
|
-
const scriptsDir = qq.join(
|
|
108
|
+
const scriptsDir = qq.join(tmp, 'macos/scripts');
|
|
114
109
|
const rootDir = buildConfig.workspace({ platform: 'darwin', arch: 'x64' });
|
|
115
110
|
const writeScript = async (script) => {
|
|
116
111
|
const path = script === 'uninstall' ? [rootDir, 'bin'] : [scriptsDir];
|
|
117
112
|
path.push(script);
|
|
118
|
-
await qq.write(path, scripts[script](config
|
|
113
|
+
await qq.write(path, scripts[script](config));
|
|
119
114
|
await qq.chmod(path, 0o755);
|
|
120
115
|
};
|
|
121
116
|
await writeScript('preinstall');
|
|
@@ -125,7 +120,7 @@ class PackMacos extends command_1.Command {
|
|
|
125
120
|
const args = [
|
|
126
121
|
'--root', rootDir,
|
|
127
122
|
'--identifier', packageIdentifier,
|
|
128
|
-
'--version',
|
|
123
|
+
'--version', version,
|
|
129
124
|
'--install-location', `/usr/local/lib/${config.dirname}`,
|
|
130
125
|
'--scripts', scriptsDir,
|
|
131
126
|
];
|
|
@@ -146,6 +141,4 @@ PackMacos.hidden = true;
|
|
|
146
141
|
PackMacos.description = 'pack CLI into macOS .pkg';
|
|
147
142
|
PackMacos.flags = {
|
|
148
143
|
root: command_1.flags.string({ char: 'r', description: 'path to oclif CLI root', default: '.', required: true }),
|
|
149
|
-
'additional-executable': command_1.flags.string({ description: `an executable other than the one listed in config.bin that should be made available to the user
|
|
150
|
-
the executable should already exist in the tarball produced by "oclif pack:tarballs"` }),
|
|
151
144
|
};
|
|
@@ -2,10 +2,6 @@ import { Command, flags } from '@oclif/command';
|
|
|
2
2
|
export default class PackTarballs extends Command {
|
|
3
3
|
static hidden: boolean;
|
|
4
4
|
static description: string;
|
|
5
|
-
static flags:
|
|
6
|
-
root: flags.IOptionFlag<string>;
|
|
7
|
-
targets: flags.IOptionFlag<string>;
|
|
8
|
-
xz: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
9
|
-
};
|
|
5
|
+
static flags: flags.Input<any>;
|
|
10
6
|
run(): Promise<void>;
|
|
11
7
|
}
|
package/lib/commands/pack/win.js
CHANGED
|
@@ -6,20 +6,20 @@ const Tarballs = require("../../tarballs");
|
|
|
6
6
|
const upload_util_1 = require("../../upload-util");
|
|
7
7
|
const scripts = {
|
|
8
8
|
/* eslint-disable no-useless-escape */
|
|
9
|
-
cmd: (config
|
|
9
|
+
cmd: (config) => `@echo off
|
|
10
10
|
setlocal enableextensions
|
|
11
11
|
|
|
12
|
-
set ${config.scopedEnvVarKey('BINPATH')}=%~dp0\\${
|
|
13
|
-
if exist "%LOCALAPPDATA%\\${config.dirname}\\client\\bin\\${
|
|
14
|
-
"%LOCALAPPDATA%\\${config.dirname}\\client\\bin\\${
|
|
12
|
+
set ${config.scopedEnvVarKey('BINPATH')}=%~dp0\\${config.bin}.cmd
|
|
13
|
+
if exist "%LOCALAPPDATA%\\${config.dirname}\\client\\bin\\${config.bin}.cmd" (
|
|
14
|
+
"%LOCALAPPDATA%\\${config.dirname}\\client\\bin\\${config.bin}.cmd" %*
|
|
15
15
|
) else (
|
|
16
|
-
"%~dp0\\..\\client\\bin\\node.exe" "%~dp0\\..\\client\\bin
|
|
16
|
+
"%~dp0\\..\\client\\bin\\node.exe" "%~dp0\\..\\client\\bin\\run" %*
|
|
17
17
|
)
|
|
18
18
|
`,
|
|
19
|
-
sh: (config
|
|
19
|
+
sh: (config) => `#!/bin/sh
|
|
20
20
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
|
|
21
21
|
|
|
22
|
-
"$basedir/../client/bin/${
|
|
22
|
+
"$basedir/../client/bin/${config.bin}.cmd" "$@"
|
|
23
23
|
ret=$?
|
|
24
24
|
exit $ret
|
|
25
25
|
`,
|
|
@@ -194,26 +194,22 @@ class PackWin extends command_1.Command {
|
|
|
194
194
|
await this.checkForNSIS();
|
|
195
195
|
const { flags } = this.parse(PackWin);
|
|
196
196
|
const buildConfig = await Tarballs.buildConfig(flags.root);
|
|
197
|
-
const { config } = buildConfig;
|
|
197
|
+
const { config, version, gitSha, targets, tmp } = buildConfig;
|
|
198
198
|
await Tarballs.build(buildConfig, { platform: 'win32', pack: false });
|
|
199
|
-
const arches =
|
|
199
|
+
const arches = targets.filter(t => t.platform === 'win32').map(t => t.arch);
|
|
200
200
|
for (const arch of arches) {
|
|
201
|
-
const installerBase = qq.join(
|
|
201
|
+
const installerBase = qq.join(tmp, `windows-${arch}-installer`);
|
|
202
202
|
// eslint-disable-next-line no-await-in-loop
|
|
203
203
|
await qq.write([installerBase, `bin/${config.bin}.cmd`], scripts.cmd(config));
|
|
204
204
|
// eslint-disable-next-line no-await-in-loop
|
|
205
205
|
await qq.write([installerBase, `bin/${config.bin}`], scripts.sh(config));
|
|
206
|
-
if (flags['additional-executable']) {
|
|
207
|
-
await qq.write([installerBase, `bin/${flags['additional-executable']}.cmd`], scripts.cmd(config, flags['additional-executable'])); // eslint-disable-line no-await-in-loop
|
|
208
|
-
await qq.write([installerBase, `bin/${flags['additional-executable']}`], scripts.sh(config, flags['additional-executable'])); // eslint-disable-line no-await-in-loop
|
|
209
|
-
}
|
|
210
206
|
// eslint-disable-next-line no-await-in-loop
|
|
211
207
|
await qq.write([installerBase, `${config.bin}.nsi`], scripts.nsis(config, arch));
|
|
212
208
|
// eslint-disable-next-line no-await-in-loop
|
|
213
209
|
await qq.mv(buildConfig.workspace({ platform: 'win32', arch }), [installerBase, 'client']);
|
|
214
210
|
// eslint-disable-next-line no-await-in-loop
|
|
215
211
|
await qq.x(`makensis ${installerBase}/${config.bin}.nsi | grep -v "\\[compress\\]" | grep -v "^File: Descending to"`);
|
|
216
|
-
const templateKey = upload_util_1.templateShortKey('win32', { bin: config.bin, version:
|
|
212
|
+
const templateKey = upload_util_1.templateShortKey('win32', { bin: config.bin, version: version, sha: gitSha, arch });
|
|
217
213
|
const o = buildConfig.dist(`win32/${templateKey}`);
|
|
218
214
|
// eslint-disable-next-line no-await-in-loop
|
|
219
215
|
await qq.mv([installerBase, 'installer.exe'], o);
|
|
@@ -259,6 +255,4 @@ PackWin.hidden = true;
|
|
|
259
255
|
PackWin.description = 'create windows installer from oclif CLI';
|
|
260
256
|
PackWin.flags = {
|
|
261
257
|
root: command_1.flags.string({ char: 'r', description: 'path to oclif CLI root', default: '.', required: true }),
|
|
262
|
-
'additional-executable': command_1.flags.string({ description: `an executable other than the one listed in config.bin that should be made available to the user
|
|
263
|
-
the executable should already exist in the tarball produced by "oclif pack:tarballs"` }),
|
|
264
258
|
};
|
|
@@ -2,18 +2,6 @@ import { Command, flags } from '@oclif/command';
|
|
|
2
2
|
export default class Promote extends Command {
|
|
3
3
|
static hidden: boolean;
|
|
4
4
|
static description: string;
|
|
5
|
-
static flags:
|
|
6
|
-
root: flags.IOptionFlag<string>;
|
|
7
|
-
version: flags.IOptionFlag<string>;
|
|
8
|
-
sha: flags.IOptionFlag<string>;
|
|
9
|
-
channel: flags.IOptionFlag<string>;
|
|
10
|
-
targets: flags.IOptionFlag<string>;
|
|
11
|
-
deb: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
12
|
-
macos: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
13
|
-
win: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
14
|
-
'max-age': flags.IOptionFlag<string>;
|
|
15
|
-
xz: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
16
|
-
indexes: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
17
|
-
};
|
|
5
|
+
static flags: flags.Input<any>;
|
|
18
6
|
run(): Promise<void>;
|
|
19
7
|
}
|
package/lib/commands/readme.d.ts
CHANGED
|
@@ -3,10 +3,7 @@ import * as Config from '@oclif/config';
|
|
|
3
3
|
export default class Readme extends Command {
|
|
4
4
|
static hidden: boolean;
|
|
5
5
|
static description: string;
|
|
6
|
-
static flags:
|
|
7
|
-
dir: flags.IOptionFlag<string>;
|
|
8
|
-
multi: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
9
|
-
};
|
|
6
|
+
static flags: flags.Input<any>;
|
|
10
7
|
run(): Promise<void>;
|
|
11
8
|
replaceTag(readme: string, tag: string, body: string): string;
|
|
12
9
|
toc(__: Config.IConfig, readme: string): string;
|
package/lib/commands/readme.js
CHANGED
|
@@ -11,8 +11,14 @@ const url_1 = require("url");
|
|
|
11
11
|
const util_1 = require("../util");
|
|
12
12
|
const help_compatibility_1 = require("../help-compatibility");
|
|
13
13
|
const normalize = require('normalize-package-data');
|
|
14
|
-
const columns = parseInt(process.env.COLUMNS, 10) || 120;
|
|
14
|
+
const columns = Number.parseInt(process.env.COLUMNS, 10) || 120;
|
|
15
15
|
const slugify = new (require('github-slugger'))();
|
|
16
|
+
const arg = (arg) => {
|
|
17
|
+
const name = arg.name.toUpperCase();
|
|
18
|
+
if (arg.required)
|
|
19
|
+
return `${name}`;
|
|
20
|
+
return `[${name}]`;
|
|
21
|
+
};
|
|
16
22
|
class Readme extends command_1.Command {
|
|
17
23
|
async run() {
|
|
18
24
|
const { flags } = this.parse(Readme);
|
|
@@ -37,7 +43,7 @@ class Readme extends command_1.Command {
|
|
|
37
43
|
readme = this.replaceTag(readme, 'usage', this.usage(config));
|
|
38
44
|
readme = this.replaceTag(readme, 'commands', flags.multi ? this.multiCommands(config, commands, flags.dir) : this.commands(config, commands));
|
|
39
45
|
readme = this.replaceTag(readme, 'toc', this.toc(config, readme));
|
|
40
|
-
readme = readme.
|
|
46
|
+
readme = readme.trimEnd();
|
|
41
47
|
readme += '\n';
|
|
42
48
|
await fs.outputFile(readmePath, readme);
|
|
43
49
|
}
|
|
@@ -204,12 +210,6 @@ USAGE
|
|
|
204
210
|
return p;
|
|
205
211
|
}
|
|
206
212
|
commandUsage(config, command) {
|
|
207
|
-
const arg = (arg) => {
|
|
208
|
-
const name = arg.name.toUpperCase();
|
|
209
|
-
if (arg.required)
|
|
210
|
-
return `${name}`;
|
|
211
|
-
return `[${name}]`;
|
|
212
|
-
};
|
|
213
213
|
const defaultUsage = () => {
|
|
214
214
|
// const flags = Object.entries(command.flags)
|
|
215
215
|
// .filter(([, v]) => !v.hidden)
|
|
@@ -10,7 +10,7 @@ class UploadDeb extends command_1.Command {
|
|
|
10
10
|
async run() {
|
|
11
11
|
const { flags } = this.parse(UploadDeb);
|
|
12
12
|
const buildConfig = await Tarballs.buildConfig(flags.root);
|
|
13
|
-
const { s3Config, config } = buildConfig;
|
|
13
|
+
const { s3Config, config, gitSha } = buildConfig;
|
|
14
14
|
const dist = (f) => buildConfig.dist(qq.join('deb', f));
|
|
15
15
|
const S3Options = {
|
|
16
16
|
Bucket: s3Config.bucket,
|
|
@@ -20,7 +20,7 @@ class UploadDeb extends command_1.Command {
|
|
|
20
20
|
this.error('Cannot find debian artifacts', {
|
|
21
21
|
suggestions: ['Run "oclif-dev pack:deb" before uploading'],
|
|
22
22
|
});
|
|
23
|
-
const cloudKeyBase = upload_util_1.commitAWSDir(config.pjson.version,
|
|
23
|
+
const cloudKeyBase = upload_util_1.commitAWSDir(config.pjson.version, gitSha, s3Config);
|
|
24
24
|
const upload = (file) => {
|
|
25
25
|
const cloudKey = `${cloudKeyBase}/apt/${file}`;
|
|
26
26
|
return aws_1.default.s3.uploadFile(dist(file), Object.assign(Object.assign({}, S3Options), { CacheControl: 'max-age=86400', Key: cloudKey }));
|
|
@@ -40,7 +40,7 @@ class UploadDeb extends command_1.Command {
|
|
|
40
40
|
await upload('InRelease');
|
|
41
41
|
if (await qq.exists(dist('Release.gpg')))
|
|
42
42
|
await upload('Release.gpg');
|
|
43
|
-
log_1.log(`done uploading deb artifacts for v${config.version}-${
|
|
43
|
+
log_1.log(`done uploading deb artifacts for v${config.version}-${gitSha}`);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.default = UploadDeb;
|
|
@@ -10,13 +10,13 @@ class UploadMacos extends command_1.Command {
|
|
|
10
10
|
async run() {
|
|
11
11
|
const { flags } = this.parse(UploadMacos);
|
|
12
12
|
const buildConfig = await Tarballs.buildConfig(flags.root);
|
|
13
|
-
const { s3Config, version, config, dist } = buildConfig;
|
|
13
|
+
const { s3Config, version, config, dist, gitSha } = buildConfig;
|
|
14
14
|
const S3Options = {
|
|
15
15
|
Bucket: s3Config.bucket,
|
|
16
16
|
ACL: s3Config.acl || 'public-read',
|
|
17
17
|
};
|
|
18
|
-
const cloudKeyBase = upload_util_1.commitAWSDir(version,
|
|
19
|
-
const templateKey = upload_util_1.templateShortKey('macos', { bin: config.bin, version, sha:
|
|
18
|
+
const cloudKeyBase = upload_util_1.commitAWSDir(version, gitSha, s3Config);
|
|
19
|
+
const templateKey = upload_util_1.templateShortKey('macos', { bin: config.bin, version, sha: gitSha });
|
|
20
20
|
const cloudKey = `${cloudKeyBase}/${templateKey}`;
|
|
21
21
|
const localPkg = dist(`macos/${templateKey}`);
|
|
22
22
|
if (await qq.exists(localPkg))
|
|
@@ -25,7 +25,7 @@ class UploadMacos extends command_1.Command {
|
|
|
25
25
|
this.error('Cannot find macOS pkg', {
|
|
26
26
|
suggestions: ['Run "oclif-dev pack:macos" before uploading'],
|
|
27
27
|
});
|
|
28
|
-
log_1.log(`done uploading macos pkg for v${version}-${
|
|
28
|
+
log_1.log(`done uploading macos pkg for v${version}-${gitSha}`);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
exports.default = UploadMacos;
|
|
@@ -2,10 +2,6 @@ import { Command, flags } from '@oclif/command';
|
|
|
2
2
|
export default class UploadTarballs extends Command {
|
|
3
3
|
static hidden: boolean;
|
|
4
4
|
static description: string;
|
|
5
|
-
static flags:
|
|
6
|
-
root: flags.IOptionFlag<string>;
|
|
7
|
-
targets: flags.IOptionFlag<string>;
|
|
8
|
-
xz: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
9
|
-
};
|
|
5
|
+
static flags: flags.Input<any>;
|
|
10
6
|
run(): Promise<void>;
|
|
11
7
|
}
|