"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseHotlinkPackageAction = void 0;
const node_path_1 = __importDefault(require("node:path"));
const HotlinkManager_1 = require("../../utilities/HotlinkManager");
const BaseRushAction_1 = require("./BaseRushAction");
class BaseHotlinkPackageAction extends BaseRushAction_1.BaseRushAction {
    constructor(options) {
        super(options);
        this._pathParameter = this.defineStringParameter({
            parameterLongName: '--path',
            argumentName: 'PATH',
            required: true,
            description: 'The path of folder of a project outside of this Rush repo, whose installation will be simulated using' +
                ' node_modules symlinks ("hotlinks").  This folder is the symlink target.'
        });
    }
    async runAsync() {
        const hotlinkManager = HotlinkManager_1.HotlinkManager.loadFromRushConfiguration(this.rushConfiguration);
        const linkedPackagePath = node_path_1.default.resolve(process.cwd(), this._pathParameter.value);
        await this.hotlinkPackageAsync(linkedPackagePath, hotlinkManager);
    }
}
exports.BaseHotlinkPackageAction = BaseHotlinkPackageAction;
//# sourceMappingURL=BaseHotlinkPackageAction.js.map