-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-repo.ts
29 lines (23 loc) · 921 Bytes
/
add-repo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Command, flags } from '@oclif/command'
import { assertIsFrameworkRoot } from '../lib/assertions'
import { addNewRepo } from '../lib/repo'
export default class AddRepo extends Command {
static description = `Wizard to add a new repo to repositories.json.
NOTE: This command must be executed from the root of the framework meta-repo.`
static flags = {
help: flags.help({ char: 'h' }),
}
async run() {
this.log('\n 📦 Add new repo to repositories.json\n')
try {
assertIsFrameworkRoot(process.cwd())
} catch (error) {
this.log('⛔️ Aborting.')
this.log(`It doesn't seem that you are executing this command from the root of the framework repo ${process.cwd()}: ${error.message}`)
return
}
await addNewRepo(process.cwd())
this.log('\n ✅ All done!')
this.log(' The new repo item has been added to the list in repositories.json\n')
}
}