"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const logger_1 = require("@pnpm/logger");
const store_path_1 = require("@pnpm/store-path");
const common_tags_1 = require("common-tags");
const path = require("path");
const createStoreController_1 = require("../../createStoreController");
const serverConnectionInfoDir_1 = require("../../serverConnectionInfoDir");
exports.default = async (opts) => {
    const store = await store_path_1.default(opts.prefix, opts.store);
    const connectionInfoDir = serverConnectionInfoDir_1.default(store);
    const serverJson = await createStoreController_1.tryLoadServerJson({
        serverJsonPath: path.join(connectionInfoDir, 'server.json'),
        shouldRetryOnNoent: false,
    });
    if (serverJson === null) {
        logger_1.globalInfo(`No server is running for the store at ${store}`);
        return;
    }
    console.log(common_tags_1.stripIndents `
    store: ${store}
    process id: ${serverJson.pid}
    remote prefix: ${serverJson.connectionOptions.remotePrefix}
  `);
};
