代码拉取完成,页面将自动刷新
#!/usr/bin/env node
const { program } = require('commander')
const api = require('./index.js')
const pkg = require('./package.json')
program.version(pkg.version)
const config = program.command('config');
const set = config.command('set')
set.option('-u --username <username>', 'set username')
.option('-t --token <token>', 'set token')
.option('-c --cookie <cookie>', 'set cookie')
.option('-x --X-CSRF-Token <XCSRFToken>')
.description('set username, token, cookie')
.action(({ username, token, cookie, XCSRFToken }) => {
if (username || token || cookie || XCSRFToken) {
api.setConfig({ username, token, cookie, XCSRFToken })
} else {
set.help()
}
})
config.command('get')
.action(api.getConfig)
const repo = program.command('repo')
repo.command('create <name>')
.description('创建仓库')
.action(api.createRepo)
repo.command('delete <repo>')
.description('删除仓库')
.action(api.deleteRepo)
repo.command('list')
.description('列出所有仓库')
.action(api.listRepo)
const pages = program.command('pages')
pages.command('build <repo>')
.description('启动/更新 pages')
.option('-d --build-directory <buildDirectory>', '部署目录', '')
.option('-b --branch <branch>', '部署分支', 'master')
.action((repo, { buildDirectory, branch }) => {
api.buildPages(repo, buildDirectory, branch)
})
program.parse(process.argv);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。