Skip to content

Commit

Permalink
Remove private package installation code
Browse files Browse the repository at this point in the history
  • Loading branch information
ShukantPal committed Jun 28, 2022
1 parent d3e40d7 commit 647f93c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 173 deletions.
40 changes: 1 addition & 39 deletions core/webdoc-cli/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,12 @@

import * as path from "path";
import * as yargs from "yargs";
import {install} from "./installer";

async function start(argv: yargs.Argv): Promise<void> {
let eula = argv.eula;

if (!eula) {
const {default: inquirer} = await import("inquirer");
const answer = await inquirer.prompt([
{
type: "list",
name: "eula",
message: "Which EULA are you using webdoc with? " +
"(pass it in --eula to skip question). " +
"Choose a license from http://www.webdoclabs.com/pricing/ :",
choices: [
{
name: "noncommercial " +
"(free for nonprofit open source only) " +
"http://www.webdoclabs.com/legal/license/license-noncommercial/",
value: "noncommercial",
},
{
name: "commercial " +
"(subscription required) " +
"http://www.webdoclabs.com/legal/license/license-commercial/",
value: "commercial",
},
],
},
]);

eula = answer.eula;
}

await install({
api: argv.api,
pkg: "@webdoc/language-parser",
eula,
});

// require after package install
const {main} = require("./main");

return (main: (args: yargs.Argv, eula: string) => Promise<void>)(argv, eula);
return (main: (args: yargs.Argv) => Promise<void>)(argv);
}

async function init(args: yargs.Argv): Promise<void> {
Expand Down
127 changes: 0 additions & 127 deletions core/webdoc-cli/src/installer.js

This file was deleted.

8 changes: 1 addition & 7 deletions core/webdoc-cli/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {RewriteFrames} from "@sentry/integrations";
import fs from "fs";
import fse from "fs-extra";
import {initLogger as initParserLogger} from "@webdoc/language-parser";
import {install} from "./installer";
import {loadTutorials} from "./load-tutorials";
import path from "path";
// $FlowFixMe
Expand Down Expand Up @@ -58,7 +57,7 @@ export function initLogger(verbose: boolean = false, quiet: boolean = false) {
}

// main() is the default command.
export async function main(argv: yargs.Argv, eula: string): Promise<void> {
export async function main(argv: yargs.Argv): Promise<void> {
initLogger(!!argv.verbose, !!argv.quiet);

const start = performance.now();
Expand Down Expand Up @@ -90,11 +89,6 @@ export async function main(argv: yargs.Argv, eula: string): Promise<void> {
global.Webdoc.userConfig = config;

for (const lang of config.languages) {
await install({
pkg: lang,
eula,
});

// $FlowFixMe
const {default: pkg} = await import(lang);

Expand Down

0 comments on commit 647f93c

Please sign in to comment.