Skip to content

Commit 3d2ee6e

Browse files
committed
fix(faas): lint
1 parent c27fef0 commit 3d2ee6e

39 files changed

+8816
-7991
lines changed

bin/clever.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ function run () {
11201120
cliparse.argument('filename', {
11211121
description: 'TODO',
11221122
}),
1123-
args.faasId
1123+
args.faasId,
11241124
],
11251125
options: [],
11261126
}, faas('deploy'));

src/commands/faas.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,30 @@ async function deploy (params) {
7070

7171
const config = await FaaSConfig.loadFunctionConf();
7272
const { id: OWNER_ID } = await User.getCurrent();
73-
const { id : functionFromConfig, compile_args, compile_check_args, compile_command, compile_env, wasm_filename } = FaaSConfig.findFunction(config);
73+
const { id: functionFromConfig, compile_args, compile_check_args, compile_command, compile_env, wasm_filename } = FaaSConfig.findFunction(config);
7474
const [inputFilename, functionFromArgs] = params.args;
7575
const FUNCTION_ID = functionFromArgs || functionFromConfig;
7676
const inputFilepath = path.resolve(process.cwd(), inputFilename);
7777

7878
Logger.info(`Deploying ${inputFilepath}`);
7979
Logger.info(`Deploying to function ${FUNCTION_ID} of user ${OWNER_ID}`);
8080

81-
let outputWasm, outputFilepath, outputWasmFilepath = null;
81+
let outputWasm; let outputFilepath; let outputWasmFilepath = null;
8282
let inputExtension = compile_command ? 'custom' : path.extname(inputFilename);
8383

8484
switch (inputExtension) {
8585
case 'custom': {
8686
checkCommand(compile_command, compile_check_args.split(' ')),
8787
inputExtension = path.extname(inputFilename);
8888
const outputFilename = getRandomFilename(inputFilename, inputExtension);
89-
outputWasmFilepath = wasm_filename ? wasm_filename : getTempWasmFilename(outputFilename);
89+
outputWasmFilepath = wasm_filename || getTempWasmFilename(outputFilename);
9090

9191
console.log('Compiling WASM...');
9292
childProcess.spawnSync(compile_command, compile_args.split(' '), {
9393
env: {
9494
...compile_env,
95-
...process.env
96-
}
95+
...process.env,
96+
},
9797
});
9898
console.log(' DONE!');
9999
outputWasm = fs.readFileSync(outputWasmFilepath);
@@ -127,12 +127,13 @@ async function deploy (params) {
127127
outputWasmFilepath = getTempWasmFilename(outputFilename);
128128

129129
console.log('Compiling WASM...');
130-
childProcess.spawnSync('go', ['build', '-o', outputWasmFilepath, inputFilepath],{
130+
childProcess.spawnSync('go', ['build', '-o', outputWasmFilepath, inputFilepath], {
131131
env: {
132-
...process.env,
133-
GOOS: 'wasip1',
134-
GOARCH: 'wasm'
135-
}});
132+
...process.env,
133+
GOOS: 'wasip1',
134+
GOARCH: 'wasm',
135+
},
136+
});
136137
console.log(' DONE!');
137138

138139
outputWasm = fs.readFileSync(outputWasmFilepath);
@@ -323,7 +324,7 @@ function checkCommand (command, args) {
323324
const checkGoCommand = childProcess.spawnSync(command, args, { stdio: 'ignore' });
324325

325326
if (checkGoCommand.error) {
326-
throw new Error(`Command '${command}' not found, it's required to deploy your project as a Clever Function`);
327+
throw new Error(`Command '${command}' not found, it's required to deploy your project as a Clever Function`);
327328
}
328329
}
329330

0 commit comments

Comments
 (0)