From 4b4899caaf40ab81545b5f552318ba102964da67 Mon Sep 17 00:00:00 2001 From: streakingman Date: Tue, 22 Feb 2022 16:10:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8cjs=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/check-git.js | 6 +++++- index.js | 2 +- package.json | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/actions/check-git.js b/actions/check-git.js index 7cc479e..8ee465b 100644 --- a/actions/check-git.js +++ b/actions/check-git.js @@ -1,5 +1,5 @@ const {execSync} = require('child_process') -export const checkGit = (propName) => { +const checkGit = (propName) => { if (!propName || propName === 'username') { console.log(`git config user.name ${execSync('git config user.name')}`) } @@ -7,3 +7,7 @@ export const checkGit = (propName) => { console.log(`git config user.email ${execSync('git config user.email')}`) } } + +module.exports = { + checkGit +} diff --git a/index.js b/index.js index 3305be1..f7511d6 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -import {checkGit} from "./actions/check-git"; +const {checkGit} = require('./actions/check-git'); const {program} = require('commander'); const fs = require('fs') diff --git a/package.json b/package.json index e731cad..7e9c217 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,13 @@ "version": "1.0.0", "description": "常用命令行", "main": "index.js", - "bin": "index.js", + "bin": { + "skm": "index.js" + }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "release": "standard-version" + "release": "standard-version", + "release&publish": "npm run release && npm publish" }, "author": "", "license": "ISC",