Skip to content

Commit d2403df

Browse files
authored
Merge pull request #1260 from ewanharris/fix/error_if_alloy_not_installed
fix(compile/hook): error if unable to find the alloy cli
2 parents d06c9f8 + 166dc3b commit d2403df

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hooks/alloy.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ exports.init = function (logger, config, cli, appc) {
123123
};
124124
}), function () {
125125

126+
if (!paths.alloy) {
127+
logger.error('The alloy CLI is not installed');
128+
logger.error('Please install it with [sudo] npm i alloy -g');
129+
process.exit(1);
130+
}
131+
126132
// compose alloy command execution
127133
var cmd = [paths.node, paths.alloy, 'compile', appDir, '--config', config];
128134
if (cli.argv['no-colors'] || cli.argv['color'] === false) { cmd.push('--no-colors'); }
@@ -194,8 +200,4 @@ exports.init = function (logger, config, cli, appc) {
194200

195201
run(build.deviceFamily, deployType, target, finished);
196202
});
197-
198-
cli.addHook('codeprocessor.pre.run', function (build, finished) {
199-
run('none', 'development', undefined, finished, SILENT);
200-
});
201203
};

0 commit comments

Comments
 (0)