Skip to content

Commit

Permalink
fix(compile/hook): error if unable to find the alloy cli
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Nov 17, 2021
1 parent d06c9f8 commit 166dc3b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hooks/alloy.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ exports.init = function (logger, config, cli, appc) {
};
}), function () {

if (!paths.alloy) {
logger.error('The alloy CLI is not installed');
logger.error('Please install it with [sudo] npm i alloy -g');
process.exit(1);
}

// compose alloy command execution
var cmd = [paths.node, paths.alloy, 'compile', appDir, '--config', config];
if (cli.argv['no-colors'] || cli.argv['color'] === false) { cmd.push('--no-colors'); }
Expand Down Expand Up @@ -194,8 +200,4 @@ exports.init = function (logger, config, cli, appc) {

run(build.deviceFamily, deployType, target, finished);
});

cli.addHook('codeprocessor.pre.run', function (build, finished) {
run('none', 'development', undefined, finished, SILENT);
});
};

0 comments on commit 166dc3b

Please sign in to comment.