You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
860 B

#!/usr/bin/env python3
4 years ago
import os, platform, sys
4 years ago
arguments = ""
4 years ago
if len( sys.argv ) > 1:
if sys.argv[ 1 ] == "--upgrade":
4 years ago
arguments += sys.argv[ 1 ]
4 years ago
else:
print( "error: Invalid argument. Use '--upgrade' switch to upgrade packages, or none to install packages." )
raise SystemExit( 1 )
4 years ago
basePath = os.path.dirname( os.path.realpath( __file__ ) )
4 years ago
scripts = {
"Darwin" : "Install/InstallDarwin.sh",
"Linux" : "Install/InstallLinux.sh",
"Windows" : "Install\\InstallWindows.ps1",
}
4 years ago
command = '"' + os.path.join( basePath, scripts[ platform.system() ] ) + '"'
4 years ago
if platform.system() == "Windows":
command = "powershell.exe -File " + command
arguments = arguments.replace( "--", "-" )
4 years ago
command += ' ' + arguments
4 years ago
print( command )
4 years ago
if os.system( command ) != 0:
print( "Command exited with error." )
raise SystemExit( 1 )