Skip to content

Commit b43fd3a

Browse files
committed
fix: simplify remove drone logic
1 parent 26b53fa commit b43fd3a

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

test-stack/prepare-test-env.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
1+
import { existsSync, readFileSync, writeFileSync } from 'fs';
22
import { dirname, join } from 'path';
33
import { fileURLToPath } from 'url';
44

@@ -40,26 +40,18 @@ async function getCurrentBlockNumber() {
4040
* @param {number} forkBlockNumber - The block number to fork from
4141
*/
4242
async function createEnvFiles(forkBlockNumber) {
43-
if (process.env.DRONE) {
44-
const LOCAL_STACK_ENV_DIR = 'local-stack-env';
45-
console.log(`Creating ${LOCAL_STACK_ENV_DIR} directory for drone test-stack`);
46-
mkdirSync(LOCAL_STACK_ENV_DIR, { recursive: true });
47-
writeFileSync(join(LOCAL_STACK_ENV_DIR, 'FORK_URL'), forkUrl);
48-
writeFileSync(join(LOCAL_STACK_ENV_DIR, 'FORK_BLOCK'), `${forkBlockNumber}`);
49-
} else {
50-
console.log('Creating .env file for docker-compose test-stack');
51-
writeFileSync(
52-
'.env',
53-
`############ THIS FILE IS GENERATED ############
43+
console.log('Creating .env file for docker-compose test-stack');
44+
writeFileSync(
45+
'.env',
46+
`############ THIS FILE IS GENERATED ############
5447
# run "node prepare-test-env.js" to regenerate #
5548
################################################
5649
5750
# blockchain node to use as the reference for the local fork
5851
FORK_URL=${forkUrl}
5952
# block number to fork from
6053
FORK_BLOCK=${forkBlockNumber}`,
61-
);
62-
}
54+
);
6355
}
6456

6557
/**

0 commit comments

Comments
 (0)