-
-
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
9b995d2
commit 619eb9d
Showing
7 changed files
with
88 additions
and
79 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,33 @@ | ||
import { execa, type Options } from 'execa'; | ||
|
||
export const createGit = async ( | ||
cwd: string, | ||
) => { | ||
const git = ( | ||
command: string, | ||
args?: string[], | ||
options?: Options, | ||
) => ( | ||
execa( | ||
'git', | ||
[command, ...(args || [])], | ||
{ | ||
cwd, | ||
...options, | ||
}, | ||
) | ||
); | ||
|
||
await git( | ||
'init', | ||
[ | ||
// In case of different default branch name | ||
'--initial-branch=master', | ||
], | ||
); | ||
|
||
await git('config', ['user.name', 'name']); | ||
await git('config', ['user.email', 'email']); | ||
|
||
return 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,16 @@ | ||
import path from 'node:path'; | ||
import { execa } from 'execa'; | ||
|
||
const gitPublishPath = path.resolve('./dist/index.js'); | ||
|
||
export const gitPublish = ( | ||
cwd: string, | ||
) => execa(gitPublishPath, { | ||
cwd, | ||
reject: false, | ||
// Remove CI env var which prevents Ink from rendering | ||
env: { | ||
PATH: process.env.PATH, | ||
}, | ||
extendEnv: false, | ||
}); |