@trydecember/cli 0.3.17 → 0.3.19
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/README.md +1 -1
- package/dist/december.js +4982 -1051
- package/package.json +1 -1
- package/scripts/postinstall.js +20 -4
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs'
|
|
2
3
|
|
|
3
4
|
// Skip in CI or monorepo development builds
|
|
4
5
|
if (process.env.CI || process.env.NODE_ENV === 'development') {
|
|
5
6
|
process.exit(0)
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
const BLUE = '\x1b[38;2;
|
|
9
|
+
const BLUE = '\x1b[38;2;137;180;248m'
|
|
9
10
|
const WHITE = '\x1b[38;2;244;244;245m'
|
|
10
11
|
const TRUNK = '\x1b[38;2;63;63;70m'
|
|
11
12
|
const RESET = '\x1b[0m'
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const message = `\n${BLUE}✱${RESET} ${WHITE}december successfully installed${RESET}\n${TRUNK}│${RESET}\n${BLUE}✱${RESET} run ${BLUE}december${RESET} to start your session\n\n`
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
if (process.platform !== 'win32' && fs.existsSync('/dev/tty')) {
|
|
18
|
+
const tty = fs.createWriteStream('/dev/tty')
|
|
19
|
+
tty.write(message)
|
|
20
|
+
tty.end()
|
|
21
|
+
process.exit(0)
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
// Intentionally swallowed: fallback to stderr if /dev/tty is unavailable
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
process.stderr.write(message)
|
|
29
|
+
} catch {
|
|
30
|
+
// Intentionally swallowed: ignore write failure if streams are closed
|
|
31
|
+
}
|