Skip to content

Commit 237e38b

Browse files
committed
fix: some appwrite dev function fixes
1 parent 725fd50 commit 237e38b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const runFunction = async ({ port, functionId, noVariables, noReload, userId } =
5555
}
5656

5757
if(!port) {
58-
let portFound = fale;
58+
let portFound = false;
5959
port = 3000;
6060
while(port < 3100) {
6161
const taken = await isPortTaken(port);
@@ -194,7 +194,7 @@ const runFunction = async ({ port, functionId, noVariables, noReload, userId } =
194194
await dockerStart(func, variables, port);
195195
} else {
196196
log('Hot-swapping function files ...');
197-
197+
198198
const functionPath = path.join(process.cwd(), func.path);
199199
const hotSwapPath = path.join(functionPath, '.appwrite/hot-swap');
200200
const buildPath = path.join(functionPath, '.appwrite/build.tar.gz');
@@ -226,7 +226,7 @@ const runFunction = async ({ port, functionId, noVariables, noReload, userId } =
226226
const filePath = path.join(hotSwapPath, f);
227227
if (fs.existsSync(filePath)) {
228228
fs.rmSync(filePath, { force: true });
229-
}
229+
}
230230

231231
const fileDir = path.dirname(filePath);
232232
if (!fs.existsSync(fileDir)) {
@@ -244,7 +244,7 @@ const runFunction = async ({ port, functionId, noVariables, noReload, userId } =
244244
cwd: hotSwapPath,
245245
file: buildPath
246246
}, ['.']);
247-
247+
248248
fs.rmSync(hotSwapPath, { recursive: true, force: true });
249249

250250
await dockerStart(func, variables, port);

templates/cli/lib/emulation/docker.js.twig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
const childProcess = require('child_process');
2+
const { localConfig } = require("../config");
3+
const path = require('path');
4+
const fs = require('fs');
5+
16
const activeDockerIds = {};
27

38
async function dockerStop(id) {

templates/cli/lib/emulation/utils.js.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const EventEmitter = require('node:events');
2+
const { projectsCreateJWT } = require('../commands/projects');
23

34
const openRuntimesVersion = 'v3';
45

0 commit comments

Comments
 (0)