Skip to content

Commit a423739

Browse files
committed
feature: cloudcmd: bin: get rid of require
1 parent 47acb8f commit a423739

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

bin/cloudcmd.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env node
22

33
import process from 'node:process';
4-
import {createRequire} from 'node:module';
54
import {promisify} from 'node:util';
65
import {tryToCatch} from 'try-to-catch';
76
import parse from 'yargs-parser';
@@ -15,7 +14,6 @@ import Info from '../package.json' with {
1514
};
1615

1716
process.on('unhandledRejection', exit);
18-
const require = createRequire(import.meta.url);
1917

2018
const isUndefined = (a) => typeof a === 'undefined';
2119

@@ -30,8 +28,6 @@ const config = createConfig({
3028
configPath,
3129
});
3230

33-
const DIR_SERVER = '../server/';
34-
3531
const maybeRoot = (a) => {
3632
if (a === '.')
3733
return process.cwd();
@@ -180,7 +176,7 @@ async function main() {
180176
return exit(error);
181177

182178
if (args.repl)
183-
repl();
179+
await repl();
184180

185181
validate.columns(args.columns);
186182
validate.theme(args.theme);
@@ -339,9 +335,9 @@ async function help() {
339335
console.log('\nGeneral help using Cloud Commander: <%s>', url);
340336
}
341337

342-
function repl() {
338+
async function repl() {
343339
console.log('REPL mode enabled (telnet localhost 1337)');
344-
require(`${DIR_SERVER}repl`);
340+
await import('../server/repl.js');
345341
}
346342

347343
async function checkUpdate() {

docker/Dockerfile.io

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN apt-get update && apt-get upgrade && apt-get autoremove && \
3737
echo "set editing-mode vi" >> /etc/inputrc && \
3838
echo "TAB: menu-complete" >> /etc/inputrc && \
3939
echo "set UTF-8" && \
40-
echo" > configure languages" && \
40+
echo " > configure languages" && \
4141
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
4242
echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen && \
4343
echo "uk_UA.UTF-8 UTF-8" >> /etc/locale.gen && \

0 commit comments

Comments
 (0)