Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xiakebot

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xiakebot - npm Package Compare versions

Comparing version 1.0.32 to 1.0.33

25

cli.js

@@ -18,10 +18,25 @@ #!/usr/bin/env node

.name("xiakebot-cli")
.option('-r, --run', "在机器人上运行目录下的module.ts")
.helpOption('-h, --help', "获取帮助信息")
.version(package_info.version, "-v, --version", "获取版本信息");
.option('-k, --key [key]', '你的机器人key')
.option('-t, --token [token]', '你的用户token')
.option('-u, --upload', "将策略上传到机器人")
.option('-p, --publish', "将策略正式发布到平台")
.helpOption('-h, --help', "帮助信息")
.version(package_info.version, "-v, --version", "版本信息");
program.parse(process.argv);
(() => __awaiter(void 0, void 0, void 0, function* () {
if (program.run) {
console.log("哈哈");
const options = program.opts();
if (options.upload) {
if (!options.key) {
console.error("缺少key参数!");
}
if (!options.token) {
console.error("缺少token参数!");
}
if (!options.key || !options.token) {
return;
}
}
else {
program.help();
}
return 0;

@@ -28,0 +43,0 @@ }))().catch(e => {

29

cli.ts

@@ -11,7 +11,10 @@ #!/usr/bin/env node

.name("xiakebot-cli")
.option('-r, --run', "在机器人上运行目录下的module.ts")
.helpOption('-h, --help', "获取帮助信息")
.version(package_info.version, "-v, --version", "获取版本信息")
// .option('-h, --help',"显示帮助命令")
.option('-k, --key [key]', '你的机器人key')
.option('-t, --token [token]', '你的用户token')
.option('-u, --upload', "将策略上传到机器人")
.option('-p, --publish', "将策略正式发布到平台")
.helpOption('-h, --help', "帮助信息")
.version(package_info.version, "-v, --version", "版本信息")
//解析传入参数

@@ -22,5 +25,19 @@ program.parse(process.argv);

(async () => {
if (program.run) {
console.log("哈哈");
const options = program.opts();
if (options.upload) {
if (!options.key) {
console.error("缺少key参数!");
}
if (!options.token) {
console.error("缺少token参数!");
}
if (!options.key || !options.token) {
return;
}
} else {
program.help();
}
return 0;

@@ -27,0 +44,0 @@ })().catch(e => {

@@ -16,2 +16,6 @@ export class bot {

export interface option {
getOption: () => Promise<object>;
}
{
"name": "xiakebot",
"version": "1.0.32",
"version": "1.0.33",
"description": "xiakebot",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc