@@ -9,7 +9,7 @@ let config = {};
9
9
let isProject = false ;
10
10
let isActions = false ;
11
11
const functionsBuildDir = `functions-build-${ Date . now ( ) } ` ;
12
- const nim = `npx -p https://apigcp.nimbella.io/downloads/nim/nimbella-cli.tgz nim` ;
12
+ const NIM_CLI = ' https://apigcp.nimbella.io/downloads/nim/nimbella-cli.tgz' ;
13
13
14
14
// Disable auto updates of nim.
15
15
process . env . NIM_DISABLE_AUTOUPDATE = '1' ;
@@ -19,7 +19,7 @@ process.env.NIM_DISABLE_AUTOUPDATE = '1';
19
19
* @param {* } run - function provided under utils by Netlify to build event functions.
20
20
*/
21
21
async function deployProject ( run ) {
22
- await run . command ( `${ nim } project deploy . --exclude=web` ) ;
22
+ await run . command ( `nim project deploy . --exclude=web` ) ;
23
23
}
24
24
25
25
/**
@@ -38,7 +38,7 @@ async function deployActions({
38
38
for ( const file of files ) {
39
39
const [ actionName , extension ] = file . split ( '.' ) ;
40
40
let command =
41
- `${ nim } action update ${ actionName } ${ join ( functionsDir , file ) } ` +
41
+ `nim action update ${ actionName } ${ join ( functionsDir , file ) } ` +
42
42
`--timeout=${ Number ( timeout ) } --memory=${ Number ( memory ) } ` +
43
43
`--web=raw --env-file=${ secretsPath } ` ;
44
44
@@ -71,16 +71,20 @@ module.exports = {
71
71
) ;
72
72
}
73
73
74
+ console . log ( 'Installing nimbella cli...' ) ;
75
+ await utils . run . command ( `npm i -g ${ NIM_CLI } ` ) ;
76
+
74
77
const nimConfig = join ( process . env . HOME , '.nimbella' ) ;
75
78
await utils . cache . restore ( nimConfig ) ;
76
79
77
80
const loggedIn = existsSync ( nimConfig ) ;
78
81
// Login if not logged in before.
79
82
if ( loggedIn ) {
80
- console . log ( 'Using cached auth credentials.' ) ;
83
+ console . log ( '\nUsing the following namespace.' ) ;
84
+ await utils . run . command ( 'nim auth current' ) ;
81
85
} else {
82
86
await utils . run . command (
83
- `${ nim } auth login ${ process . env . NIMBELLA_LOGIN_TOKEN } `
87
+ `nim auth login ${ process . env . NIMBELLA_LOGIN_TOKEN } `
84
88
) ;
85
89
86
90
// Cache the nimbella config to avoid logging in for consecutive builds.
0 commit comments