@dx-pkg/mksymlink 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/examples/advanced-usage.d.ts +0 -1
- package/examples/advanced-usage.js +0 -1
- package/examples/basic-usage.d.ts +0 -1
- package/examples/basic-usage.js +0 -1
- package/examples/config-usage.d.ts +0 -1
- package/examples/config-usage.js +0 -1
- package/examples/cross-platform.d.ts +0 -1
- package/examples/cross-platform.js +0 -1
- package/examples/index.d.ts +0 -1
- package/examples/index.js +0 -1
- package/package.json +2 -2
- package/src/commands/config/config.command-factory.d.ts +0 -1
- package/src/commands/config/config.command-factory.js +0 -1
- package/src/commands/config/config.command.d.ts +0 -1
- package/src/commands/config/config.command.js +0 -1
- package/src/commands/config/config.option-validator.d.ts +0 -1
- package/src/commands/config/config.option-validator.js +0 -1
- package/src/commands/create/mksymlink.command-factory.d.ts +0 -1
- package/src/commands/create/mksymlink.command-factory.js +0 -1
- package/src/commands/create/mksymlink.command.d.ts +0 -1
- package/src/commands/create/mksymlink.command.js +0 -1
- package/src/commands/create/mksymlink.option-validator.d.ts +0 -1
- package/src/commands/create/mksymlink.option-validator.js +0 -1
- package/src/commands/index.d.ts +0 -1
- package/src/commands/index.js +0 -1
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/services/config.service.d.ts +0 -1
- package/src/services/config.service.js +0 -1
- package/src/services/platform-detector.d.ts +0 -1
- package/src/services/platform-detector.js +0 -1
- package/src/services/symlink-error.d.ts +0 -1
- package/src/services/symlink-error.js +0 -1
- package/src/services/symlink-manager.d.ts +0 -1
- package/src/services/symlink-manager.js +0 -1
- package/src/services/symlink.service.d.ts +0 -1
- package/src/services/symlink.service.js +0 -1
- package/src/types/index.d.ts +0 -1
- package/src/types/index.js +0 -1
- package/src/commands/config.command-factory.d.ts +0 -5
- package/src/commands/config.command-factory.js +0 -18
- package/src/commands/config.command.d.ts +0 -22
- package/src/commands/config.command.js +0 -80
- package/src/commands/config.option-validator.d.ts +0 -9
- package/src/commands/config.option-validator.js +0 -41
- package/src/commands/mksymlink.command-factory.d.ts +0 -5
- package/src/commands/mksymlink.command-factory.js +0 -20
- package/src/commands/mksymlink.command.d.ts +0 -22
- package/src/commands/mksymlink.command.js +0 -68
- package/src/commands/mksymlink.option-validator.d.ts +0 -9
- package/src/commands/mksymlink.option-validator.js +0 -35
- package/src/services/os-detector.d.ts +0 -11
- package/src/services/os-detector.js +0 -36
package/README.md
CHANGED
|
@@ -168,6 +168,7 @@ npx mksymlink config set symlink.defaultDir ~/test-symlinks
|
|
|
168
168
|
npx mksymlink config list
|
|
169
169
|
npx mksymlink config get symlink.defaultDir
|
|
170
170
|
npx mksymlink config unset symlink.defaultDir
|
|
171
|
+
npx mksymlink config info
|
|
171
172
|
|
|
172
173
|
# Create mode
|
|
173
174
|
npx mksymlink create -s /path/to/source -t /path/to/target
|
package/examples/basic-usage.js
CHANGED
package/examples/config-usage.js
CHANGED
package/examples/index.d.ts
CHANGED
package/examples/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dx-pkg/mksymlink",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Create symbolic links across platforms (macOS, Windows)",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"mksymlink": "src/commands/index.js"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"build": "tsc -p tsconfig.prod.json",
|
|
23
23
|
"watch": "tsc -p tsconfig.json --watch",
|
|
24
24
|
"dev": "tsc-watch -b --onSuccess \"npm start\"",
|
|
25
25
|
"start": "node ../../dist/packages/mksymlink/examples/index.js",
|
package/src/commands/index.d.ts
CHANGED
package/src/commands/index.js
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -9,4 +9,3 @@ export * from './commands/create/mksymlink.command-factory';
|
|
|
9
9
|
export * from './commands/config/config.command';
|
|
10
10
|
export * from './commands/config/config.option-validator';
|
|
11
11
|
export * from './commands/config/config.command-factory';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/src/index.js
CHANGED
|
@@ -25,4 +25,3 @@ __exportStar(require("./commands/create/mksymlink.command-factory"), exports);
|
|
|
25
25
|
__exportStar(require("./commands/config/config.command"), exports);
|
|
26
26
|
__exportStar(require("./commands/config/config.option-validator"), exports);
|
|
27
27
|
__exportStar(require("./commands/config/config.command-factory"), exports);
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
package/src/types/index.d.ts
CHANGED
package/src/types/index.js
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigCommandFactory = void 0;
|
|
4
|
-
const logger_1 = require("@dx-tools/logger");
|
|
5
|
-
const config_command_1 = require("./config.command");
|
|
6
|
-
const config_option_validator_1 = require("./config.option-validator");
|
|
7
|
-
const config_service_1 = require("../services/config.service");
|
|
8
|
-
class ConfigCommandFactory {
|
|
9
|
-
static create(options) {
|
|
10
|
-
const validator = new config_option_validator_1.ConfigOptionValidator();
|
|
11
|
-
validator.validate(options);
|
|
12
|
-
const logger = new logger_1.ConsoleLogger();
|
|
13
|
-
const configService = new config_service_1.ConfigService();
|
|
14
|
-
return new config_command_1.ConfigCommand(logger, configService, options);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.ConfigCommandFactory = ConfigCommandFactory;
|
|
18
|
-
//# sourceMappingURL=config.command-factory.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@dx-pkg/logger';
|
|
2
|
-
import { Command } from '../types';
|
|
3
|
-
import { ConfigService } from '../services/config.service';
|
|
4
|
-
export type ConfigAction = 'get' | 'set' | 'unset' | 'list';
|
|
5
|
-
export interface ConfigCommandOptions {
|
|
6
|
-
action: ConfigAction;
|
|
7
|
-
key?: string;
|
|
8
|
-
value?: string;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
export declare class ConfigCommand implements Command<ConfigCommandOptions> {
|
|
12
|
-
private readonly logger;
|
|
13
|
-
private readonly configService;
|
|
14
|
-
private readonly options;
|
|
15
|
-
constructor(logger: Logger, configService: ConfigService, options: ConfigCommandOptions);
|
|
16
|
-
execute(): Promise<void>;
|
|
17
|
-
private handleGet;
|
|
18
|
-
private handleSet;
|
|
19
|
-
private handleUnset;
|
|
20
|
-
private handleList;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=config.command.d.ts.map
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigCommand = void 0;
|
|
4
|
-
class ConfigCommand {
|
|
5
|
-
logger;
|
|
6
|
-
configService;
|
|
7
|
-
options;
|
|
8
|
-
constructor(logger, configService, options) {
|
|
9
|
-
this.logger = logger;
|
|
10
|
-
this.configService = configService;
|
|
11
|
-
this.options = options;
|
|
12
|
-
}
|
|
13
|
-
async execute() {
|
|
14
|
-
try {
|
|
15
|
-
const { action, key, value } = this.options;
|
|
16
|
-
switch (action) {
|
|
17
|
-
case 'get':
|
|
18
|
-
await this.handleGet(key);
|
|
19
|
-
break;
|
|
20
|
-
case 'set':
|
|
21
|
-
await this.handleSet(key, value);
|
|
22
|
-
break;
|
|
23
|
-
case 'unset':
|
|
24
|
-
await this.handleUnset(key);
|
|
25
|
-
break;
|
|
26
|
-
case 'list':
|
|
27
|
-
await this.handleList();
|
|
28
|
-
break;
|
|
29
|
-
default:
|
|
30
|
-
throw new Error(`Unknown config action: ${action}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
this.logger.error(`Config command failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
35
|
-
throw error;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async handleGet(key) {
|
|
39
|
-
if (!key) {
|
|
40
|
-
throw new Error('Key is required for get action');
|
|
41
|
-
}
|
|
42
|
-
const value = this.configService.get(key);
|
|
43
|
-
if (value === undefined) {
|
|
44
|
-
this.logger.warning(`Config key '${key}' not found`);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
this.logger.info(value);
|
|
48
|
-
}
|
|
49
|
-
async handleSet(key, value) {
|
|
50
|
-
if (!key) {
|
|
51
|
-
throw new Error('Key is required for set action');
|
|
52
|
-
}
|
|
53
|
-
if (!value) {
|
|
54
|
-
throw new Error('Value is required for set action');
|
|
55
|
-
}
|
|
56
|
-
this.configService.set(key, value);
|
|
57
|
-
this.logger.success(`Config set: ${key} = ${value}`);
|
|
58
|
-
}
|
|
59
|
-
async handleUnset(key) {
|
|
60
|
-
if (!key) {
|
|
61
|
-
throw new Error('Key is required for unset action');
|
|
62
|
-
}
|
|
63
|
-
this.configService.unset(key);
|
|
64
|
-
this.logger.success(`Config unset: ${key}`);
|
|
65
|
-
}
|
|
66
|
-
async handleList() {
|
|
67
|
-
const config = this.configService.list();
|
|
68
|
-
const entries = Object.entries(config);
|
|
69
|
-
if (entries.length === 0) {
|
|
70
|
-
this.logger.info('No configuration found');
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
this.logger.info('Current configuration:');
|
|
74
|
-
for (const [key, value] of entries) {
|
|
75
|
-
this.logger.info(` ${key} = ${value}`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.ConfigCommand = ConfigCommand;
|
|
80
|
-
//# sourceMappingURL=config.command.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CommandOptionsValidator } from '../types';
|
|
2
|
-
import { ConfigCommandOptions } from './config.command';
|
|
3
|
-
export declare class ConfigOptionValidator implements CommandOptionsValidator<ConfigCommandOptions> {
|
|
4
|
-
validate(options: ConfigCommandOptions): void;
|
|
5
|
-
private validateAction;
|
|
6
|
-
private validateKey;
|
|
7
|
-
private validateValue;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=config.option-validator.d.ts.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigOptionValidator = void 0;
|
|
4
|
-
const symlink_error_1 = require("../services/symlink-error");
|
|
5
|
-
const VALID_ACTIONS = ['get', 'set', 'unset', 'list'];
|
|
6
|
-
class ConfigOptionValidator {
|
|
7
|
-
validate(options) {
|
|
8
|
-
this.validateAction(options.action);
|
|
9
|
-
this.validateKey(options.action, options.key);
|
|
10
|
-
this.validateValue(options.action, options.value);
|
|
11
|
-
}
|
|
12
|
-
validateAction(action) {
|
|
13
|
-
if (!VALID_ACTIONS.includes(action)) {
|
|
14
|
-
throw new symlink_error_1.SymlinkError(`Invalid config action: ${action}. Must be one of: ${VALID_ACTIONS.join(', ')}`, 'INVALID_CONFIG_ACTION');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
validateKey(action, key) {
|
|
18
|
-
if (action === 'list') {
|
|
19
|
-
return; // list doesn't require a key
|
|
20
|
-
}
|
|
21
|
-
if (!key) {
|
|
22
|
-
throw new symlink_error_1.SymlinkError(`Key is required for '${action}' action`, 'MISSING_CONFIG_KEY');
|
|
23
|
-
}
|
|
24
|
-
if (typeof key !== 'string' || key.trim().length === 0) {
|
|
25
|
-
throw new symlink_error_1.SymlinkError(`Invalid config key: ${key}. Key must be a non-empty string.`, 'INVALID_CONFIG_KEY');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
validateValue(action, value) {
|
|
29
|
-
if (action !== 'set') {
|
|
30
|
-
return; // only 'set' requires a value
|
|
31
|
-
}
|
|
32
|
-
if (!value) {
|
|
33
|
-
throw new symlink_error_1.SymlinkError(`Value is required for 'set' action`, 'MISSING_CONFIG_VALUE');
|
|
34
|
-
}
|
|
35
|
-
if (typeof value !== 'string') {
|
|
36
|
-
throw new symlink_error_1.SymlinkError(`Invalid config value: ${value}. Value must be a string.`, 'INVALID_CONFIG_VALUE');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.ConfigOptionValidator = ConfigOptionValidator;
|
|
41
|
-
//# sourceMappingURL=config.option-validator.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MkSymlinkCommandFactory = void 0;
|
|
4
|
-
const logger_1 = require("@dx-pkg/logger");
|
|
5
|
-
const mksymlink_command_1 = require("./create/mksymlink.command");
|
|
6
|
-
const mksymlink_option_validator_1 = require("./create/mksymlink.option-validator");
|
|
7
|
-
const symlink_manager_1 = require("../services/symlink-manager");
|
|
8
|
-
const platform_detector_1 = require("../services/platform-detector");
|
|
9
|
-
class MkSymlinkCommandFactory {
|
|
10
|
-
static create(options) {
|
|
11
|
-
const validator = new mksymlink_option_validator_1.MkSymlinkOptionValidator();
|
|
12
|
-
validator.validate(options);
|
|
13
|
-
const logger = new logger_1.ConsoleLogger();
|
|
14
|
-
const osDetector = new platform_detector_1.PlatformDetector();
|
|
15
|
-
const symlinkManager = new symlink_manager_1.SymlinkService(logger, osDetector);
|
|
16
|
-
return new mksymlink_command_1.MkSymlinkCommand(logger, symlinkManager, options);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.MkSymlinkCommandFactory = MkSymlinkCommandFactory;
|
|
20
|
-
//# sourceMappingURL=mksymlink.command-factory.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@dx-tools/logger';
|
|
2
|
-
import { Command, WindowsSymlinkType, SymlinkOperations } from '../types';
|
|
3
|
-
import { ConfigService } from '../services/config.service';
|
|
4
|
-
export interface MkSymlinkCommandOptions {
|
|
5
|
-
target?: string;
|
|
6
|
-
source?: string;
|
|
7
|
-
type?: WindowsSymlinkType;
|
|
8
|
-
force?: boolean;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
export declare const SYMLINK_TYPES: readonly WindowsSymlinkType[];
|
|
12
|
-
export declare class MkSymlinkCommand implements Command<MkSymlinkCommandOptions> {
|
|
13
|
-
private readonly logger;
|
|
14
|
-
private readonly symlinkManager;
|
|
15
|
-
private readonly options;
|
|
16
|
-
private readonly configService;
|
|
17
|
-
constructor(logger: Logger, symlinkManager: SymlinkOperations, options: MkSymlinkCommandOptions, configService?: ConfigService);
|
|
18
|
-
execute(): Promise<void>;
|
|
19
|
-
private resolveOptions;
|
|
20
|
-
private generateDefaultTarget;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=mksymlink.command.d.ts.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MkSymlinkCommand = exports.SYMLINK_TYPES = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const config_service_1 = require("../services/config.service");
|
|
6
|
-
exports.SYMLINK_TYPES = ['file', 'dir', 'junction'];
|
|
7
|
-
class MkSymlinkCommand {
|
|
8
|
-
logger;
|
|
9
|
-
symlinkManager;
|
|
10
|
-
options;
|
|
11
|
-
configService;
|
|
12
|
-
constructor(logger, symlinkManager, options, configService = new config_service_1.ConfigService()) {
|
|
13
|
-
this.logger = logger;
|
|
14
|
-
this.symlinkManager = symlinkManager;
|
|
15
|
-
this.options = options;
|
|
16
|
-
this.configService = configService;
|
|
17
|
-
}
|
|
18
|
-
async execute() {
|
|
19
|
-
try {
|
|
20
|
-
const { source, target, type, force } = this.resolveOptions();
|
|
21
|
-
this.logger.info('Creating symlink with options:');
|
|
22
|
-
this.logger.info(` Source: ${source}`);
|
|
23
|
-
this.logger.info(` Target: ${target}`);
|
|
24
|
-
this.logger.info(` Type: ${type}`);
|
|
25
|
-
this.logger.info(` Force: ${force}`);
|
|
26
|
-
const result = await this.symlinkManager.createSymlink({
|
|
27
|
-
source,
|
|
28
|
-
target,
|
|
29
|
-
type,
|
|
30
|
-
force,
|
|
31
|
-
});
|
|
32
|
-
if (!result.success) {
|
|
33
|
-
if (result.error) {
|
|
34
|
-
throw result.error;
|
|
35
|
-
}
|
|
36
|
-
this.logger.warning(result.message || 'Symlink creation failed');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
this.logger.success('Symlink created successfully!');
|
|
40
|
-
this.logger.info(` Source: ${result.source}`);
|
|
41
|
-
this.logger.info(` Target: ${result.target}`);
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
this.logger.error(`Failed to create symlink: ${error instanceof Error ? error.message : String(error)}`);
|
|
45
|
-
throw error;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
resolveOptions() {
|
|
49
|
-
const currentDir = process.cwd();
|
|
50
|
-
const source = this.options.source || currentDir;
|
|
51
|
-
const target = this.options.target || this.generateDefaultTarget(currentDir);
|
|
52
|
-
const type = this.options.type || 'dir';
|
|
53
|
-
const force = this.options.force || false;
|
|
54
|
-
return { source, target, type, force };
|
|
55
|
-
}
|
|
56
|
-
generateDefaultTarget(currentDir) {
|
|
57
|
-
const currentBasename = (0, path_1.basename)(currentDir);
|
|
58
|
-
const parentDir = (0, path_1.dirname)(currentDir);
|
|
59
|
-
const parentBasename = (0, path_1.basename)(parentDir);
|
|
60
|
-
const symlinkName = `${parentBasename}--${currentBasename}`;
|
|
61
|
-
// Check if there's a configured default directory
|
|
62
|
-
const configuredDir = this.configService.getDefaultSymlinkDir();
|
|
63
|
-
const defaultSymlinkDir = configuredDir || currentDir;
|
|
64
|
-
return (0, path_1.resolve)(defaultSymlinkDir, symlinkName);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.MkSymlinkCommand = MkSymlinkCommand;
|
|
68
|
-
//# sourceMappingURL=mksymlink.command.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CommandOptionsValidator } from '../types';
|
|
2
|
-
import { MkSymlinkCommandOptions } from './mksymlink.command';
|
|
3
|
-
export declare class MkSymlinkOptionValidator implements CommandOptionsValidator<MkSymlinkCommandOptions> {
|
|
4
|
-
validate(options: MkSymlinkCommandOptions): void;
|
|
5
|
-
private validateType;
|
|
6
|
-
private validateSource;
|
|
7
|
-
private validateForce;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=mksymlink.option-validator.d.ts.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MkSymlinkOptionValidator = void 0;
|
|
4
|
-
const symlink_error_1 = require("../services/symlink-error");
|
|
5
|
-
const mksymlink_command_1 = require("./mksymlink.command");
|
|
6
|
-
const fs_1 = require("fs");
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
class MkSymlinkOptionValidator {
|
|
9
|
-
validate(options) {
|
|
10
|
-
this.validateType(options.type);
|
|
11
|
-
this.validateSource(options.source);
|
|
12
|
-
this.validateForce(options.force);
|
|
13
|
-
}
|
|
14
|
-
validateType(type) {
|
|
15
|
-
if (type && !mksymlink_command_1.SYMLINK_TYPES.includes(type)) {
|
|
16
|
-
throw new symlink_error_1.SymlinkError(`Invalid symlink type: ${type}. Must be one of: ${mksymlink_command_1.SYMLINK_TYPES.join(', ')}`, 'INVALID_SYMLINK_TYPE');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
validateSource(source) {
|
|
20
|
-
if (!source) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const resolvedSource = (0, path_1.resolve)(source);
|
|
24
|
-
if (!(0, fs_1.existsSync)(resolvedSource)) {
|
|
25
|
-
throw new symlink_error_1.SymlinkError(`Source path does not exist: ${resolvedSource}`, 'SOURCE_NOT_FOUND');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
validateForce(force) {
|
|
29
|
-
if (force !== undefined && typeof force !== 'boolean') {
|
|
30
|
-
throw new symlink_error_1.SymlinkError(`Invalid force option: ${force}. Must be a boolean.`, 'INVALID_FORCE_OPTION');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.MkSymlinkOptionValidator = MkSymlinkOptionValidator;
|
|
35
|
-
//# sourceMappingURL=mksymlink.option-validator.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PlatformInformation, OSPlatform } from '../types';
|
|
2
|
-
export declare class PlatformDetector implements PlatformInformation {
|
|
3
|
-
private readonly _platform;
|
|
4
|
-
constructor();
|
|
5
|
-
private normalizePlatform;
|
|
6
|
-
getPlatform(): OSPlatform;
|
|
7
|
-
isWindows(): boolean;
|
|
8
|
-
isMacOS(): boolean;
|
|
9
|
-
isLinux(): boolean;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=os-detector.d.ts.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlatformDetector = void 0;
|
|
4
|
-
const os_1 = require("os");
|
|
5
|
-
class PlatformDetector {
|
|
6
|
-
_platform;
|
|
7
|
-
constructor() {
|
|
8
|
-
this._platform = this.normalizePlatform((0, os_1.platform)());
|
|
9
|
-
}
|
|
10
|
-
normalizePlatform(osPlatform) {
|
|
11
|
-
switch (osPlatform) {
|
|
12
|
-
case 'darwin':
|
|
13
|
-
return 'darwin';
|
|
14
|
-
case 'win32':
|
|
15
|
-
return 'win32';
|
|
16
|
-
case 'linux':
|
|
17
|
-
return 'linux';
|
|
18
|
-
default:
|
|
19
|
-
return 'unknown';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
getPlatform() {
|
|
23
|
-
return this._platform;
|
|
24
|
-
}
|
|
25
|
-
isWindows() {
|
|
26
|
-
return this._platform === 'win32';
|
|
27
|
-
}
|
|
28
|
-
isMacOS() {
|
|
29
|
-
return this._platform === 'darwin';
|
|
30
|
-
}
|
|
31
|
-
isLinux() {
|
|
32
|
-
return this._platform === 'linux';
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.PlatformDetector = PlatformDetector;
|
|
36
|
-
//# sourceMappingURL=os-detector.js.map
|