Skip to content

Commit 6ac71c9

Browse files
Merge pull request appwrite#929 from appwrite/chore-run-function
chore(cli): Reversing running with variable logic
2 parents 81524aa + 32c5fcd commit 6ac71c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const { systemHasCommand, isPortTaken, getAllFiles } = require('../utils');
1717
const { runtimeNames, systemTools, JwtManager, Queue } = require('../emulation/utils');
1818
const { dockerStop, dockerCleanup, dockerStart, dockerBuild, dockerPull } = require('../emulation/docker');
1919

20-
const runFunction = async ({ port, functionId, noVariables, noReload, userId } = {}) => {
20+
const runFunction = async ({ port, functionId, withVariables, noReload, userId } = {}) => {
2121
// Selection
2222
if(!functionId) {
2323
const answers = await inquirer.prompt(questionsRunFunctions[0]);
@@ -115,7 +115,7 @@ const runFunction = async ({ port, functionId, noVariables, noReload, userId } =
115115
const userVariables = {};
116116
const variables = {};
117117

118-
if(!noVariables) {
118+
if(withVariables) {
119119
try {
120120
const { variables: remoteVariables } = await paginate(functionsListVariables, {
121121
functionId: func['$id'],
@@ -127,7 +127,7 @@ const runFunction = async ({ port, functionId, noVariables, noReload, userId } =
127127
userVariables[v.key] = v.value;
128128
});
129129
} catch(err) {
130-
warn("Remote variables not fetched. Production environment variables will not be avaiable. Reason: " + err.message);
130+
warn("Remote variables not fetched. Production environment variables will not be available. Reason: " + err.message);
131131
}
132132
}
133133

@@ -184,7 +184,7 @@ const runFunction = async ({ port, functionId, noVariables, noReload, userId } =
184184
const ignorer = ignore();
185185
ignorer.add('.appwrite');
186186
ignorer.add('code.tar.gz');
187-
187+
188188
if (func.ignore) {
189189
ignorer.add(func.ignore);
190190
} else if (fs.existsSync(path.join(functionPath, '.gitignore'))) {
@@ -321,7 +321,7 @@ run
321321
.option(`--function-id <function-id>`, `ID of function to run`)
322322
.option(`--port <port>`, `Local port`)
323323
.option(`--user-id <user-id>`, `ID of user to impersonate`)
324-
.option(`--no-variables`, `Prevent pulling variables from function settings`)
324+
.option(`--with-variables`, `Run with function variables from function settings`)
325325
.option(`--no-reload`, `Prevent live reloading of server when changes are made to function files`)
326326
.action(actionRunner(runFunction));
327327

0 commit comments

Comments
 (0)