From eb9483abb6b70e0da1611b8409f2bbb1359038c2 Mon Sep 17 00:00:00 2001 From: Chris Raible Date: Tue, 29 Oct 2024 15:21:46 -0700 Subject: [PATCH] Fixed git remote configuration in dev container (#21459) no issue - When creating a dev container, the onCreateCommand script will try to setup the git remotes according to the environment variables defined for e.g. `$GHOST_UPSTREAM`. There was a bug that caused the `origin` remote to successfully be renamed to `$GHOST_UPSTREAM`, but the `origin` remote was not being created successfully on the first try. This commit fixes that bug. --- .devcontainer/onCreateCommand.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/onCreateCommand.js b/.devcontainer/onCreateCommand.js index da30bb4c93..594d711a72 100644 --- a/.devcontainer/onCreateCommand.js +++ b/.devcontainer/onCreateCommand.js @@ -54,6 +54,7 @@ function setupGitRemotes() { } } + remotes = execSync('git remote').toString().trim().split('\n'); if (GHOST_FORK_REMOTE_URL) { const remoteName = GHOST_FORK_REMOTE_NAME || 'origin'; // Check if the fork remote already exists