From 4f1e76935e7c0728a4604db11e6889d420cb0a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Thu, 17 May 2018 09:40:36 +0000 Subject: [PATCH] Fix JavaScript packages installation --- certidude/cli.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/certidude/cli.py b/certidude/cli.py index 7e32ac9..faecc4b 100755 --- a/certidude/cli.py +++ b/certidude/cli.py @@ -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: