Skip to content

Commit

Permalink
Merge branch 'Hotfix' into Stable
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanHurst committed Nov 14, 2018
2 parents f65d7a6 + f17819f commit d783cba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions ADSMSettings/management/commands/compilestatic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import subprocess
import os
import platform

from django.core.management import BaseCommand, call_command
from django.conf import settings
Expand Down Expand Up @@ -32,7 +33,7 @@ def handle(self, *args, **options):
os.chdir(settings.BASE_DIR)

command_path = os.path.join('.', 'node_modules', '.bin', 'webpack')
command = command_path + ' --config %s' % config_file
webpack = subprocess.Popen(command, cwd=os.path.join(settings.BASE_DIR), shell=True)
command = [command_path, '--config %s' % config_file]
webpack = subprocess.Popen(command, cwd=os.path.join(settings.BASE_DIR), shell=(platform.system() != 'Darwin'))
webpack.communicate() # Wait for webpack to finish compile
call_command('collectstatic')
5 changes: 3 additions & 2 deletions ADSMSettings/management/commands/devserver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import subprocess
import os
import platform

from django.core.management import BaseCommand, call_command
from django.conf import settings
Expand Down Expand Up @@ -30,6 +31,6 @@ def handle(self, *args, **options):
config_file = 'webpack.config.js'

command_path = os.path.join('.', 'node_modules', '.bin', 'webpack')
command = command_path + ' --config %s --watch' % config_file
webpack = subprocess.Popen(command, cwd=os.path.join(settings.BASE_DIR), shell=True)
command = [command_path, '--config %s --watch' % config_file]
webpack = subprocess.Popen(command, cwd=os.path.join(settings.BASE_DIR), shell=(platform.system() != 'Darwin'))
call_command('runserver')
6 changes: 3 additions & 3 deletions ADSMSettings/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def launch_external_program_and_exit(launch, code=0, close_self=True, cmd_args=N
else:
launch_args.update(preexec_fn=os.setsid)
launch_args.update(start_new_session=True)
subprocess.Popen(launch, stdin=subprocess.PIPE, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **launch_args)
subprocess.Popen(launch, stdin=subprocess.PIPE, shell=(platform.system() != 'Darwin'), stdout=subprocess.PIPE, stderr=subprocess.PIPE, **launch_args)
if close_self:
sys.exit(code)

Expand All @@ -327,7 +327,7 @@ def check_simulation_version():
version = None
try:
executable = adsm_executable_command()[0]
process = subprocess.Popen(executable + " --version --silent", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
process = subprocess.Popen([executable, "--version --silent"], shell=(platform.system() != 'Darwin'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
output, error = process.communicate(timeout=200)
exit_code = process.returncode
Expand Down Expand Up @@ -356,7 +356,7 @@ def npu_update_info():
new_version = None
try:
npu = os.path.join(settings.BASE_DIR, 'npu'+settings.EXTENSION)
process = subprocess.Popen(npu + " --check_update --silent", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
process = subprocess.Popen([npu, "--check_update", "--silent"], shell=(platform.system() != 'Darwin'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
output, error = process.communicate(timeout=60000)
exit_code = process.returncode
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import stat
import pip
import platform
import shutil
import subprocess

Expand Down Expand Up @@ -210,8 +211,9 @@ def run(self):

print("Preparing to pack client files...")
webpack_command_path = os.path.join('.', 'node_modules', '.bin', 'webpack')
webpack_command = webpack_command_path + ' --config webpack.config.js'
webpack = subprocess.Popen(webpack_command, cwd=os.path.join(settings.BASE_DIR), shell=True)
webpack_command = [webpack_command_path, '--config webpack.config.js']
webpack = subprocess.Popen(webpack_command, cwd=os.path.join(settings.BASE_DIR), shell=(platform.system() != 'Darwin'))

print("Packing client files...")
outs, errs = webpack.communicate() # TODO: Possible error checking
print("Done packing.")
Expand Down

0 comments on commit d783cba

Please sign in to comment.