File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11export namespace Flag {
22 export const OPENCODE_AUTO_SHARE = truthy ( "OPENCODE_AUTO_SHARE" )
3+ export const OPENCODE_GIT_USER_NAME = process . env [ "OPENCODE_GIT_USER_NAME" ] || "shuvcode"
4+ export const OPENCODE_GIT_USER_EMAIL = process . env [ "OPENCODE_GIT_USER_EMAIL" ] || "shuvcode@localhost"
35 export const OPENCODE_GIT_BASH_PATH = process . env [ "OPENCODE_GIT_BASH_PATH" ]
46 export const OPENCODE_CONFIG = process . env [ "OPENCODE_CONFIG" ]
57 export const OPENCODE_CONFIG_DIR = process . env [ "OPENCODE_CONFIG_DIR" ]
Original file line number Diff line number Diff line change @@ -267,12 +267,16 @@ export namespace Project {
267267 if ( ! isGitRepo ) {
268268 // Initialize git and create empty initial commit (required for project ID which is the first commit hash)
269269 await $ `git init` . cwd ( projectPath ) . quiet ( )
270- await $ `git commit --allow-empty -m "Initial commit"` . cwd ( projectPath ) . quiet ( )
270+ await $ `git -c user.name=${ Flag . OPENCODE_GIT_USER_NAME } -c user.email=${ Flag . OPENCODE_GIT_USER_EMAIL } commit --allow-empty -m "Initial commit"`
271+ . cwd ( projectPath )
272+ . quiet ( )
271273 } else {
272274 // Check if there are any commits
273275 const hasCommits = await $ `git rev-list -n 1 --all` . cwd ( projectPath ) . quiet ( ) . nothrow ( ) . text ( )
274276 if ( ! hasCommits . trim ( ) ) {
275- await $ `git commit --allow-empty -m "Initial commit"` . cwd ( projectPath ) . quiet ( )
277+ await $ `git -c user.name=${ Flag . OPENCODE_GIT_USER_NAME } -c user.email=${ Flag . OPENCODE_GIT_USER_EMAIL } commit --allow-empty -m "Initial commit"`
278+ . cwd ( projectPath )
279+ . quiet ( )
276280 }
277281 }
278282
You can’t perform that action at this time.
0 commit comments