Skip to content

Commit dff294d

Browse files
committed
feat(cli): pulling variable to .env only
1 parent 0cc8391 commit dff294d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/cli/lib/commands/pull.js.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ const pullFunctions = async ({ code, withVariables }) => {
8888
if (!localFunction['path']) {
8989
func['path'] = `functions/${func.name}`;
9090
}
91-
if (!withVariables) {
92-
delete func['vars'];
93-
}
91+
const holdingVars = func['vars'];
92+
// We don't save var in to the config
93+
delete func['vars'];
9494
localConfig.addFunction(func);
9595

9696
if (!fs.existsSync(func['path'])) {
@@ -162,7 +162,7 @@ const pullFunctions = async ({ code, withVariables }) => {
162162
} catch {
163163
}
164164

165-
fs.writeFileSync(envFileLocation, func['vars'].map(r => `${r.key}=${r.value}\n`).join(''))
165+
fs.writeFileSync(envFileLocation, holdingVars.map(r => `${r.key}=${r.value}\n`).join(''))
166166
}
167167
}
168168

0 commit comments

Comments
 (0)