// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import path from 'node:path';
import { HotlinkManager } from '../../utilities/HotlinkManager';
import { BaseRushAction } from './BaseRushAction';
export class BaseHotlinkPackageAction extends 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.loadFromRushConfiguration(this.rushConfiguration);
        const linkedPackagePath = path.resolve(process.cwd(), this._pathParameter.value);
        await this.hotlinkPackageAsync(linkedPackagePath, hotlinkManager);
    }
}
//# sourceMappingURL=BaseHotlinkPackageAction.js.map