spine-framework 0.1.1 → 0.1.2
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/.framework/cli/index.ts +21 -0
- package/package.json +1 -1
package/.framework/cli/index.ts
CHANGED
|
@@ -41,6 +41,21 @@
|
|
|
41
41
|
|
|
42
42
|
import './env-loader.ts'
|
|
43
43
|
import { Command } from 'commander'
|
|
44
|
+
import { createRequire } from 'module'
|
|
45
|
+
import { resolve, dirname } from 'path'
|
|
46
|
+
import { fileURLToPath } from 'url'
|
|
47
|
+
|
|
48
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
49
|
+
const __dirname = dirname(__filename)
|
|
50
|
+
|
|
51
|
+
function printWelcome() {
|
|
52
|
+
const require = createRequire(import.meta.url)
|
|
53
|
+
try {
|
|
54
|
+
require(resolve(__dirname, 'welcome.cjs'))
|
|
55
|
+
} catch {
|
|
56
|
+
console.log('Spine Framework — run `spine-framework --help` for commands.')
|
|
57
|
+
}
|
|
58
|
+
}
|
|
44
59
|
|
|
45
60
|
const program = new Command()
|
|
46
61
|
|
|
@@ -100,6 +115,12 @@ registerInstallAppCommands(program)
|
|
|
100
115
|
registerStatusCommands(program)
|
|
101
116
|
registerUninstallAppCommands(program)
|
|
102
117
|
|
|
118
|
+
// Show welcome when run with no arguments
|
|
119
|
+
if (process.argv.length === 2) {
|
|
120
|
+
printWelcome()
|
|
121
|
+
process.exit(0)
|
|
122
|
+
}
|
|
123
|
+
|
|
103
124
|
program.parseAsync(process.argv).catch((err) => {
|
|
104
125
|
console.error('Error:', err.message)
|
|
105
126
|
process.exit(1)
|