forked from OpenWF/SpaceNinjaServer
		
	chore: abort update and start scripts when .git folder is missing (#2702)
In that case, updating is obviously not possible. Reviewed-on: OpenWF/SpaceNinjaServer#2702 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									30398021b3
								
							
						
					
					
						commit
						287acab892
					
				@ -2,24 +2,27 @@
 | 
			
		||||
 | 
			
		||||
echo Updating SpaceNinjaServer...
 | 
			
		||||
git fetch --prune
 | 
			
		||||
git stash
 | 
			
		||||
git checkout -f origin/main
 | 
			
		||||
if %errorlevel% == 0 (
 | 
			
		||||
	git stash
 | 
			
		||||
	git checkout -f origin/main
 | 
			
		||||
 | 
			
		||||
if exist static\data\0\ (
 | 
			
		||||
	if exist static\data\0\ (
 | 
			
		||||
		echo Updating stripped assets...
 | 
			
		||||
		cd static\data\0\
 | 
			
		||||
		git pull
 | 
			
		||||
		cd ..\..\..\
 | 
			
		||||
)
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
echo Updating dependencies...
 | 
			
		||||
call npm i --omit=dev
 | 
			
		||||
	echo Updating dependencies...
 | 
			
		||||
	call npm i --omit=dev
 | 
			
		||||
 | 
			
		||||
call npm run build
 | 
			
		||||
if %errorlevel% == 0 (
 | 
			
		||||
	call npm run build
 | 
			
		||||
	if %errorlevel% == 0 (
 | 
			
		||||
		call npm run start
 | 
			
		||||
		echo SpaceNinjaServer seems to have crashed.
 | 
			
		||||
	)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
:a
 | 
			
		||||
pause > nul
 | 
			
		||||
goto a
 | 
			
		||||
 | 
			
		||||
@ -2,22 +2,23 @@
 | 
			
		||||
 | 
			
		||||
echo "Updating SpaceNinjaServer..."
 | 
			
		||||
git fetch --prune
 | 
			
		||||
git stash
 | 
			
		||||
git checkout -f origin/main
 | 
			
		||||
if [ $? -eq 0 ]; then
 | 
			
		||||
    git stash
 | 
			
		||||
    git checkout -f origin/main
 | 
			
		||||
 | 
			
		||||
if [ -d "static/data/0/" ]; then
 | 
			
		||||
    if [ -d "static/data/0/" ]; then
 | 
			
		||||
        echo "Updating stripped assets..."
 | 
			
		||||
        cd static/data/0/
 | 
			
		||||
        git pull
 | 
			
		||||
        cd ../../../
 | 
			
		||||
fi
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
echo "Updating dependencies..."
 | 
			
		||||
npm i --omit=dev
 | 
			
		||||
    echo "Updating dependencies..."
 | 
			
		||||
    npm i --omit=dev
 | 
			
		||||
 | 
			
		||||
npm run build
 | 
			
		||||
if [ $? -eq 0 ]; then
 | 
			
		||||
    npm run build
 | 
			
		||||
    if [ $? -eq 0 ]; then
 | 
			
		||||
        npm run start
 | 
			
		||||
        echo "SpaceNinjaServer seems to have crashed."
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user