"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const link_1 = require("../api/link");
exports.default = (input, opts) => {
    const cwd = opts && opts.prefix || process.cwd();
    // pnpm link
    if (!input || !input.length) {
        return link_1.linkToGlobal(cwd, opts);
    }
    // pnpm link ../foo
    if (input[0].indexOf('.') === 0) {
        const linkFrom = path.join(cwd, input[0]);
        return link_1.default(linkFrom, cwd, opts);
    }
    // pnpm link foo
    return link_1.linkFromGlobal(input[0], cwd, opts);
};
//# sourceMappingURL=link.js.map