Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodp committed Jul 4, 2020
1 parent 7f09231 commit a64dee4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 22 deletions.
5 changes: 3 additions & 2 deletions dist/modules/app/AppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppController = void 0;
const fs_1 = require("fs");
const path_1 = require("path");
const util_1 = require("util");
Expand Down Expand Up @@ -229,10 +230,10 @@ class AppController {
hasErrors = true;
this.showException(err, options, cli);
}
for (let file of files) {
for (let file of files || []) {
cli.newLine(cli.symbolSuccess, 'Generated script', cli.colorHighlight(file));
}
for (let err of errors) {
for (let err of errors || []) {
// cli.newLine( cli.symbolError, err.message );
this.showException(err, options, cli);
}
Expand Down
1 change: 1 addition & 0 deletions dist/modules/plugin/PluginController.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PluginController = void 0;
const PluginDrawer_1 = require("./PluginDrawer");
const PluginManager_1 = require("./PluginManager");
const PackageBasedPluginFinder_1 = require("./PackageBasedPluginFinder");
Expand Down
10 changes: 6 additions & 4 deletions dist/modules/plugin/PluginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PluginManager = void 0;
const childProcess = require("child_process");
const inquirer = require("inquirer");
const fs = require("fs");
const inquirer = require("inquirer");
const path_1 = require("path");
const PluginData_1 = require("./PluginData");
const read_file_1 = require("../util/read-file");
const PluginData_1 = require("./PluginData");
/**
* Plug-in manager
*
Expand Down Expand Up @@ -103,7 +104,8 @@ class PluginManager {
}
// Install the plug-in as a DEVELOPMENT dependency using NPM
const PACKAGE_MANAGER = 'NPM';
const INSTALL_DEV_CMD = 'npm install --save-dev ' + name + ' --color=always';
// App @1 to install only plugins compatible with Concordia 1.x
const INSTALL_DEV_CMD = 'npm install --save-dev ' + name + '@1 --no-fund --no-audit --loglevel error --color=always';
drawer.showMessageTryingToInstall(name, PACKAGE_MANAGER);
const code = yield this.runCommand(INSTALL_DEV_CMD);
drawer.showCommandCode(code, false);
Expand All @@ -130,7 +132,7 @@ class PluginManager {
}
// Remove with a package manager
drawer.showMessageTryingToUninstall(name, 'NPM');
let code = yield this.runCommand('npm uninstall --save-dev ' + name + ' --color=always');
let code = yield this.runCommand('npm uninstall --save-dev ' + name + ' --no-fund --no-audit --color=always');
drawer.showCommandCode(code);
});
}
Expand Down
6 changes: 3 additions & 3 deletions modules/app/AppController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ export class AppController {
this.showException( err, options, cli );
}

for ( let file of files ) {
for ( let file of files || [] ) {
cli.newLine( cli.symbolSuccess, 'Generated script', cli.colorHighlight( file ) );
}

for ( let err of errors ) {
for ( let err of errors || [] ) {
// cli.newLine( cli.symbolError, err.message );
this.showException( err, options, cli );
}
Expand Down Expand Up @@ -355,4 +355,4 @@ export class AppController {
return "\n DETAILS: " + err.stack.substring( err.stack.indexOf( "\n" ) );
}

}
}
4 changes: 2 additions & 2 deletions modules/dbi/DatabaseInterface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Database } from "../ast/Database";
import { Queryable } from "./Queryable";
import { Table } from "modules/ast";
import { Table } from "../ast/Table";

/**
* Database interface
Expand Down Expand Up @@ -56,4 +56,4 @@ export interface DatabaseInterface extends Queryable {

/// @see more methods in Queryable

}
}
2 changes: 1 addition & 1 deletion modules/plugin/PluginController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ export class PluginController {
return true;
};

}
}
22 changes: 12 additions & 10 deletions modules/plugin/PluginManager.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import * as childProcess from 'child_process';
import * as inquirer from 'inquirer';
import { Plugin } from 'concordialang-plugin';
import * as fs from 'fs';
import * as inquirer from 'inquirer';
import { join } from 'path';
import { Plugin } from "concordialang-plugin";
import { CLI } from 'modules/app/CLI';
import { PluginData, PLUGIN_PREFIX } from "./PluginData";
import { PluginDrawer } from "./PluginDrawer";
import { PluginFinder } from "./PluginFinder";

import { CLI } from '../app/CLI';
import { readFileAsync } from '../util/read-file';
import { PLUGIN_PREFIX, PluginData } from './PluginData';
import { PluginDrawer } from './PluginDrawer';
import { PluginFinder } from './PluginFinder';

/**
* Plug-in manager
Expand Down Expand Up @@ -122,8 +123,9 @@ export class PluginManager {

// Install the plug-in as a DEVELOPMENT dependency using NPM

const PACKAGE_MANAGER = 'NPM';
const INSTALL_DEV_CMD = 'npm install --save-dev ' + name + ' --color=always';
const PACKAGE_MANAGER = 'NPM';
// App @1 to install only plugins compatible with Concordia 1.x
const INSTALL_DEV_CMD = 'npm install --save-dev ' + name + '@1 --no-fund --no-audit --loglevel error --color=always';

drawer.showMessageTryingToInstall( name, PACKAGE_MANAGER );
const code: number = await this.runCommand( INSTALL_DEV_CMD );
Expand Down Expand Up @@ -156,7 +158,7 @@ export class PluginManager {

// Remove with a package manager
drawer.showMessageTryingToUninstall( name, 'NPM' );
let code: number = await this.runCommand( 'npm uninstall --save-dev ' + name + ' --color=always' );
let code: number = await this.runCommand( 'npm uninstall --save-dev ' + name + ' --no-fund --no-audit --color=always' );
drawer.showCommandCode( code );
}

Expand Down Expand Up @@ -255,4 +257,4 @@ export class PluginManager {
return new context[ className ]( ... args );
}

}
}

0 comments on commit a64dee4

Please sign in to comment.