Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.sh not re-entrant #115

Open
tangentsoft opened this issue May 26, 2020 · 0 comments
Open

build.sh not re-entrant #115

tangentsoft opened this issue May 26, 2020 · 0 comments

Comments

@tangentsoft
Copy link

If the build fails and you retry it after fixing something, it gripes:

Retrieving latest Visual Studio Code sources into [code]
fatal: destination path 'code' already exists and is not an empty directory.

It should detect this condition and just do a git pull in there, not try to re-clone the repo. Trivial patch:

diff --git a/build.sh b/build.sh
index 390f697354..3e9f7749fd 100755
--- a/build.sh
+++ b/build.sh
@@ -5,7 +5,12 @@ echo "Installing NVM and NodeJS";
 . ./setup_nvm.sh;
 
 echo "Retrieving latest Visual Studio Code sources into [code]";
-git clone "https://github.com/Microsoft/vscode.git" code;
+if [ -d code ]
+then
+    ( cd code ; git pull )
+else
+    git clone "https://github.com/Microsoft/vscode.git" code;
+fi
   
 echo "Setting current owner as owner of code folder";
 chown ${USER:=$(/usr/bin/id -run)}:$USER -R code;

By the way, semicolons at the end of lines in shell scripts do nothing useful. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant