@@ -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