Fix JavaScript packages installation

This commit is contained in:
Lauri Võsandi 2018-05-17 09:40:36 +00:00
parent e41f284b0e
commit 4f1e76935e
1 changed files with 6 additions and 8 deletions

View File

@ -1030,7 +1030,7 @@ def certidude_setup_authority(username, kerberos_keytab, nginx_config, tls_confi
env = Environment(loader=PackageLoader("certidude", "templates"), trim_blocks=True)
if skip_packages:
click.echo("Not attempting to install packages from APT as requested...")
click.echo("Not attempting to install packages as requested...")
else:
click.echo("Installing packages...")
cmd = "DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \
@ -1065,6 +1065,11 @@ def certidude_setup_authority(username, kerberos_keytab, nginx_config, tls_confi
else:
click.echo("Web server nginx already installed")
cmd = "npm install --silent --no-optional -g nunjucks@2.5.2 nunjucks-date@1.2.0 node-forge bootstrap@4.0.0-alpha.6 jquery timeago tether font-awesome qrcode-svg"
click.echo("Installing JavaScript packages: %s" % cmd)
if os.system(cmd):
raise click.ClickException("Failed to install JavaScript packages")
if not os.path.exists("/usr/bin/node"):
os.symlink("/usr/bin/nodejs", "/usr/bin/node")
@ -1193,13 +1198,6 @@ def certidude_setup_authority(username, kerberos_keytab, nginx_config, tls_confi
click.echo("Creating directory %s" % subdir)
os.makedirs(subdir)
# Install JavaScript pacakges
if skip_packages:
click.echo("Not attempting to install packages from NPM as requested...")
else:
cmd = "npm install --silent --no-optional -g nunjucks@2.5.2 nunjucks-date@1.2.0 node-forge bootstrap@4.0.0-alpha.6 jquery timeago tether font-awesome qrcode-svg"
click.echo("Installing JavaScript packages: %s" % cmd)
if skip_assets:
click.echo("Not attempting to assemble assets as requested...")
else: