more ESM cleanups

This commit is contained in:
Girish Ramakrishnan
2026-02-14 16:52:16 +01:00
parent e9f96593c3
commit b71e503a01
4 changed files with 42 additions and 49 deletions
+8 -9
View File
@@ -1,19 +1,18 @@
#!/usr/bin/env node
// --check is used by run-tests to verify sudo access works.
// It must exit before loading the full module graph (which requires BOX_ENV).
import backuptask from '../backuptask.js';
import database from '../database.js';
import debugModule from 'debug';
import safe from 'safetydance';
const debug = debugModule('box:backupupload');
// --check is used by run-tests to verify sudo access works. Caller must set BOX_ENV (e.g. BOX_ENV=test).
if (process.argv[2] === '--check') {
console.log('OK');
process.exit(0);
}
const { default: backuptask } = await import('../backuptask.js');
const { default: database } = await import('../database.js');
const { default: debugModule } = await import('debug');
const { default: safe } = await import('safetydance');
const debug = debugModule('box:backupupload');
// Main process starts here
const remotePath = process.argv[2];
const format = process.argv[3];