-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.mjs
More file actions
67 lines (59 loc) · 1.73 KB
/
main.mjs
File metadata and controls
67 lines (59 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// primary exports
export { createBackupManager } from './src/backup_manager/backup_manager.mjs';
export {
initBackupDir,
getBackupCreationDate,
getBackupInfo,
getEntryInfo,
getFileStreamByBackupPath,
getFolderContents,
getSubtree,
listBackups,
deleteBackup,
deleteBackupDir,
performBackup,
performRestore,
pruneUnreferencedFiles,
renameBackup,
runInteractiveSession,
} from './src/backup_manager/backup_helper_funcs.mjs';
export { SymlinkModes } from './src/lib/fs.mjs';
// additional exports
export { DEFAULT_IN_MEMORY_CUTOFF_SIZE } from './src/backup_manager/backup_manager.mjs';
export {
BACKUP_PATH_SEP,
BITS_PER_BYTE,
CURRENT_BACKUP_VERSION,
DEFAULT_COMPRESS_PARAMS,
deleteBackupDirInternal,
getBackupDirInfo,
getHashOutputSizeBits,
hashAlgoKnown,
HEX_CHAR_LENGTH_BITS,
INSECURE_HASHES,
isValidBackupDir,
knownHashAlgos,
MIN_BACKUP_VERSION,
RECOMMENDED_MINIMUM_HASH_LENGTH_BITS,
VARIABLE_LENGTH_HAHSHES,
} from './src/backup_manager/lib.mjs';
export {
getLzmaInstalled,
getNativeLibInstalled,
getProgramVersion,
} from './src/backup_manager/version.mjs';
export {
executeCommandLine,
executeCommandLineCollectOutput,
} from './src/command_line/command_line.mjs';
export { getVersionString } from './src/command_line/help_info.mjs';
// check for running as main
import { realpath } from 'node:fs/promises';
import { dirname } from 'node:path';
import { executeCommandLine } from './src/command_line/command_line.mjs';
const nodeCalledFilePath = await realpath(process.argv[1]);
const thisFilePath = await realpath(import.meta.filename);
if (nodeCalledFilePath == thisFilePath || nodeCalledFilePath == dirname(thisFilePath)) {
// execute main cli code
await executeCommandLine();
}