Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions templates/cli/lib/commands/push.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ const pushSettings = async () => {
}
}

const pushFunction = async ({ functionId, async, code, withVariables } = { returnOnZero: false }) => {
const pushFunction = async ({ functionId, async, code } = { returnOnZero: false }) => {
process.chdir(localConfig.configDirectoryPath)

const functionIds = [];
Expand Down Expand Up @@ -1146,39 +1146,6 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
}
}

if (withVariables) {
updaterRow.update({ status: 'Updating variables' }).replaceSpinner(SPINNER_ARC);

const { variables } = await paginate(functionsListVariables, {
functionId: func['$id'],
parseOutput: false
}, 100, 'variables');

await Promise.all(variables.map(async variable => {
await functionsDeleteVariable({
functionId: func['$id'],
variableId: variable['$id'],
parseOutput: false
});
}));

let result = await awaitPools.wipeVariables(func['$id']);
if (!result) {
updaterRow.fail({ errorMessage: `Variable deletion timed out.` })
return;
}

// Deploy local variables
await Promise.all((func['vars'] ?? []).map(async variable => {
await functionsCreateVariable({
functionId: func['$id'],
key: variable['key'],
value: variable['value'],
parseOutput: false
});
}));
}

if (code === false) {
successfullyPushed++;
successfullyDeployed++;
Expand Down Expand Up @@ -1692,7 +1659,6 @@ push
.option(`-f, --function-id <function-id>`, `ID of function to run`)
.option(`-A, --async`, `Don't wait for functions deployments status`)
.option("--no-code", "Don't push the function's code")
.option("--with-variables", `Push function variables.`)
.action(actionRunner(pushFunction));

push
Expand Down