feat: add update and start script for linux (#2107)
Reviewed-on: OpenWF/SpaceNinjaServer#2107 Co-authored-by: Sainan <sainan@calamity.gg> Co-committed-by: Sainan <sainan@calamity.gg>
This commit is contained in:
		
							parent
							
								
									28da982c80
								
							
						
					
					
						commit
						32f4c5105a
					
				
							
								
								
									
										23
									
								
								UPDATE AND START SERVER.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										23
									
								
								UPDATE AND START SERVER.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Updating SpaceNinjaServer..."
 | 
				
			||||||
 | 
					git fetch --prune
 | 
				
			||||||
 | 
					git stash
 | 
				
			||||||
 | 
					git reset --hard origin/main
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -d "static/data/0/" ]; then
 | 
				
			||||||
 | 
					    echo "Updating stripped assets..."
 | 
				
			||||||
 | 
					    cd static/data/0/
 | 
				
			||||||
 | 
					    git pull
 | 
				
			||||||
 | 
					    cd ../../../
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Updating dependencies..."
 | 
				
			||||||
 | 
					npm i --omit=dev
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					npm run build
 | 
				
			||||||
 | 
					if [ $? -eq 0 ]; then
 | 
				
			||||||
 | 
					    npm run start
 | 
				
			||||||
 | 
					    echo "SpaceNinjaServer seems to have crashed."
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user