rage-framework/cli/src/index.ts
Danya H 828a3deb33 upd cli
- added rpc tests
- removed git clone
2024-10-28 12:10:58 +00:00

58 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import c from 'chalk'
import { select } from '@inquirer/prompts'
import { checkForUpdates } from './utils/update'
import { initProject } from './commands/create'
import { downloadUpdater } from './commands/download-updater'
import { testRpc } from './commands/test-rpc'
enum Actions {
INIT_PROJECT = 'INIT_PROJECT',
TEST_RPC = 'TEST_RPC',
UPDATER = 'UPDATER',
}
;(async () => {
await checkForUpdates()
console.log(c.blueBright('Rage FW CLI | Powered by Entity Seven Group <3'))
const action = await select({
message: c.gray('Select action:'),
choices: [
{
name: 'Initialize a new project',
value: Actions.INIT_PROJECT,
description: 'Initialize a new project and start developing',
},
{
name: 'Test our RPC',
value: Actions.TEST_RPC,
description:
'Initialize a new skeleton project with our RPC set up',
},
{
name: 'Install RAGE:MP updater',
value: Actions.UPDATER,
description:
'Use our tool to download or update RAGE:MP server files in two clicks',
},
],
loop: true,
})
switch (action) {
case Actions.INIT_PROJECT:
await initProject()
break
case Actions.TEST_RPC:
await testRpc()
break
case Actions.UPDATER:
await downloadUpdater()
break
default:
console.log(c.red('Something went wrong..'))
}
})()