| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /**
- * 更新发布工具
- *
- * Copyright © 2025 imengyu.top imengyu-update-server
- */
- import { program } from 'commander';
- import { login, checkLogged, logout, initAuth } from './auth.mjs';
- import { testVersion, getVersion, getUpdate } from './app.mjs';
- //程序入口
- //============================================
- program
- .command('login <user>')
- .description('登录')
- .action(login);
- program
- .command('logstate')
- .description('检查登录状态')
- .action(checkLogged);
- program
- .command('logout')
- .description('退出登录')
- .action(logout);
- program
- .command('test <version>')
- .description('测试更新入口')
- .action(testVersion);
- program
- .command('version <action> [type]')
- .description('查看版本信息/发布版本/删除版本/设置版本, action 可选 view/new/delete/set-web-update/set-app-update/set-next-app-update')
- .action(getVersion);
- program
- .command('update <action> [type] [all]')
- .description('查看更新信息/发布更新, action 可选 view/post, view type 可选 id/all; post type 可选 web/app')
- .option('--skip', '跳过构建')
- .option('--ndelete', '不删除构建文件')
- .action(getUpdate);
- function start() {
- program.parse(process.argv);
- }
- initAuth().then(start);
- process.on('unhandledRejection', (reason, p) => {
- console.error('Promise: ', p, 'Reason: ', reason)
- })
|