Skip to content

Commit

Permalink
Merge pull request #959 from appwrite/feat-removing-vars
Browse files Browse the repository at this point in the history
feat(cli): pulling variable to .env only
  • Loading branch information
christyjacob4 authored Aug 27, 2024
2 parents 9165e69 + dff294d commit 6ee8749
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/cli/lib/commands/pull.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ const pullFunctions = async ({ code, withVariables }) => {
if (!localFunction['path']) {
func['path'] = `functions/${func.name}`;
}
if (!withVariables) {
delete func['vars'];
}
const holdingVars = func['vars'];
// We don't save var in to the config
delete func['vars'];
localConfig.addFunction(func);

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

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

Expand Down

0 comments on commit 6ee8749

Please sign in to comment.