-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1d8415
commit c8d975e
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
## StreakingMan Cli | ||
|
||
### 查看git当前配置名称和邮箱 | ||
### 查看当前仓库git配置名称和邮箱 | ||
``` | ||
skm check-git | ||
``` | ||
|
||
## 配置当前仓库git配置用户名和邮箱 | ||
``` | ||
skm set-git | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const {execSync} = require('child_process') | ||
const inquirer = require('inquirer') | ||
const setGit = async () => { | ||
const name = await inquirer.prompt([ | ||
{ | ||
type: 'input', | ||
name: 'name', | ||
message: 'user.name', | ||
default: 'streakingman', | ||
}, | ||
]) | ||
const email = await inquirer.prompt([ | ||
{ | ||
type: 'input', | ||
name: 'email', | ||
message: 'user.email', | ||
default: '[email protected]', | ||
}, | ||
]) | ||
execSync(`git config user.name ${name}`) | ||
execSync(`git config user.email ${email}`) | ||
console.log('设置完成,当前配置:\n') | ||
console.log(`git config user.name ${execSync('git config user.name')}`.trim()) | ||
console.log(`git config user.email ${execSync('git config user.email')}`) | ||
} | ||
|
||
module.exports = { | ||
setGit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters