@thegetty/quire-cli 1.0.0-pre-release.2 → 1.0.0-pre-release.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/package.json +2 -2
- package/scripts/postinstall.js +27 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegetty/quire-cli",
|
|
3
3
|
"description": "Quire command-line interface",
|
|
4
|
-
"version": "1.0.0-pre-release.
|
|
4
|
+
"version": "1.0.0-pre-release.3",
|
|
5
5
|
"author": "Getty Digital",
|
|
6
6
|
"license": "J Paul Getty Trust",
|
|
7
7
|
"bugs": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"type": "module",
|
|
20
20
|
"files": [
|
|
21
21
|
"bin/",
|
|
22
|
+
"scripts",
|
|
22
23
|
"src/",
|
|
23
24
|
"CHANGELOG.md",
|
|
24
25
|
"LICENSE",
|
|
@@ -35,7 +36,6 @@
|
|
|
35
36
|
"scripts": {
|
|
36
37
|
"lint": "eslint src --ext .js",
|
|
37
38
|
"lint:fix": "npm run lint -- --fix",
|
|
38
|
-
"postinstall": "node scripts/postinstall.js",
|
|
39
39
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
40
40
|
},
|
|
41
41
|
"imports": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node --no-warnings
|
|
2
|
+
import chalk from 'chalk'
|
|
3
|
+
|
|
4
|
+
// @todo use an i18n string for the documentation url
|
|
5
|
+
const docsUrl = 'https://quire.getty.edu/docs/quire-cli/'
|
|
6
|
+
|
|
7
|
+
const showSuccessMessage = () => {
|
|
8
|
+
const heading = chalk.inverse.green('Success!')
|
|
9
|
+
const messsage = chalk.magenta(
|
|
10
|
+
'Quire CLI installed! Please visit ',
|
|
11
|
+
chalk.underline(docsUrl),
|
|
12
|
+
' for more information.'
|
|
13
|
+
)
|
|
14
|
+
console.log(heading, messsage)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
// check if the cli is a global installation of quire-cli
|
|
19
|
+
const npmArgs = JSON.parse(process.env['npm_config_argv'])
|
|
20
|
+
if (npmArgs.cooked && npmArgs.cooked.includes('--global')) {
|
|
21
|
+
showSuccessMessage()
|
|
22
|
+
// @todo run `quire-cli --help` on success
|
|
23
|
+
// cli('--help')
|
|
24
|
+
}
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error('postinstall', error)
|
|
27
|
+
}
|