- handled process exit
- updated docs + readme
- typos fix
This commit is contained in:
2024-10-30 18:31:53 +00:00
parent 7e43e0d106
commit 495217ecd5
5 changed files with 54 additions and 30 deletions
+6 -5
View File
@@ -18,19 +18,19 @@ export async function initProject() {
if (!framework) {
framework = await select({
message: c.gray('Select frontend:'),
message: c.gray('Select front-end:'),
default: 'react-18',
loop: true,
choices: [
{
name: 'React + TypeScript (Vite)',
name: 'React 18',
value: 'react-18',
description: 'React + TypeScript (Vite) as a frontend',
description: 'React 18 + TypeScript (Vite) as a front-end',
},
],
})
} else {
console.log(c.gray('Frontend:'), framework)
console.log(c.gray('Front-end:'), framework)
}
console.log(
@@ -38,7 +38,7 @@ export async function initProject() {
folder,
c.gray('with'),
framework,
c.gray('as a frontend..'),
c.gray('as a front-end..'),
)
cloneBranch(
@@ -56,5 +56,6 @@ export async function initProject() {
})
.catch(e => {
console.log(c.red('Error occured: \n', e))
console.log(c.red('Please open an issue if you see this'))
})
}
+7 -6
View File
@@ -5,14 +5,14 @@ import { cloneBranch } from '../utils/cloner'
const choices = {
'rpc-react-18': {
name: 'Vite + React 18 + TypeScript',
name: 'React 18',
value: 'rpc-react-18',
description: 'Vite + React 18 + TypeScript as a frontend',
description: 'Vite + React 18 + TypeScript as a front-end',
},
'rpc-svelte-5': {
name: 'Vite + Svelte 5 + TypeScript',
name: 'Svelte 5',
value: 'rpc-svelte-5',
description: 'Vite + Svelte 5 + TypeScript as a frontend',
description: 'Vite + Svelte 5 + TypeScript as a front-end',
},
} as const
@@ -31,13 +31,13 @@ export async function testRpc() {
if (!framework) {
framework = await select({
message: c.gray('Select frontend:'),
message: c.gray('Select front-end:'),
default: 'rpc-react-18',
loop: true,
choices: Object.values(choices),
})
} else {
console.log(c.gray('Frontend:'), framework)
console.log(c.gray('Front-end:'), framework)
}
console.log(
@@ -63,5 +63,6 @@ export async function testRpc() {
})
.catch(e => {
console.log(c.red('Error occured: \n', e))
console.log(c.red('Please open an issue if you see this'))
})
}
+14 -4
View File
@@ -12,10 +12,19 @@ enum Actions {
UPDATER = 'UPDATER',
}
process.on('exit', () => {
console.log(c.blueBright('\n\nRage FW CLI | Exiting..'))
process.exit(0)
})
process.on('SIGINT', () => {
console.log(c.blueBright('\n\nRage FW CLI | Exiting..'))
process.exit(0)
})
;(async () => {
await checkForUpdates()
console.log(c.blueBright('Rage FW CLI | Powered by Entity Seven Group <3'))
console.log(c.blueBright('Rage FW CLI | Powered by Entity Seven Group <3'))
const action = await select({
message: c.gray('Select action:'),
@@ -26,16 +35,16 @@ enum Actions {
description: 'Initialize a new project and start developing',
},
{
name: 'Test our RPC',
name: 'Test our Rpc',
value: Actions.TEST_RPC,
description:
'Initialize a new skeleton project with our RPC set up',
'Initialize a new skeleton project with our Rpc all set',
},
{
name: 'Install RAGE:MP updater',
value: Actions.UPDATER,
description:
'Use our tool to download or update RAGE:MP server files in two clicks',
'Use our tool to download or update RAGE:MP server files in just two clicks',
},
],
loop: true,
@@ -53,5 +62,6 @@ enum Actions {
break
default:
console.log(c.red('Something went wrong..'))
console.log(c.red('Please open an issue if you see this'))
}
})()