tslint
This commit is contained in:
parent
7ee67544e5
commit
a86b912520
3
.npmignore
Normal file
3
.npmignore
Normal file
@ -0,0 +1,3 @@
|
||||
/src/
|
||||
/tsconfig.json
|
||||
/tslint.json
|
@ -19,13 +19,13 @@
|
||||
"devDependencies": {
|
||||
"@types/dateformat": "^3.0.1",
|
||||
"@types/fs-extra": "^9.0.4",
|
||||
"@types/semver": "^7.3.4",
|
||||
"@types/node": "^14.14.9",
|
||||
"@types/tar": "^4.0.4",
|
||||
"tslint": "^6.1.3",
|
||||
"typescript": "^4.0.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/semver": "^7.3.4",
|
||||
"dateformat": "^4.0.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
"semver": "^7.3.2",
|
||||
|
@ -49,7 +49,7 @@ export class PluginManager {
|
||||
}
|
||||
|
||||
public getLoaded(): IPlugin[] {
|
||||
const list = []
|
||||
const list = [];
|
||||
for (const pl of this.plugins.values()) {
|
||||
list.push(pl);
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
export * from './manager';
|
||||
export * from './repository';
|
||||
export * from './repository';
|
||||
|
@ -7,10 +7,10 @@ import tar from 'tar';
|
||||
import { httpGET } from '../../common';
|
||||
import { logger } from '../../core';
|
||||
|
||||
import { IEnvironment } from "../../types";
|
||||
import { IEnvironment } from '../../types';
|
||||
import { PluginManager } from '../manager';
|
||||
import { IPlugin, IPluginManifest } from "../plugin";
|
||||
import { IRepoPluginDef, IRepository } from "./repository";
|
||||
import { IPlugin, IPluginManifest } from '../plugin';
|
||||
import { IRepoPluginDef, IRepository } from './repository';
|
||||
|
||||
export class RepositoryManager {
|
||||
private repositories: Map<string, IRepository> = new Map();
|
||||
@ -52,7 +52,7 @@ export class RepositoryManager {
|
||||
}
|
||||
|
||||
public getAll(): IRepository[] {
|
||||
const list = []
|
||||
const list = [];
|
||||
for (const irep of this.repositories.values()) {
|
||||
list.push(irep);
|
||||
}
|
||||
@ -69,7 +69,7 @@ export class RepositoryManager {
|
||||
const pluginPath = repo.url + '/' + srcFile;
|
||||
const tempdir = path.join(this.env.path, await fs.mkdtemp('.sbdl'));
|
||||
const tempfile = path.join(tempdir, srcFile);
|
||||
let manifest
|
||||
let manifest;
|
||||
|
||||
try {
|
||||
const save = await httpGET(pluginPath, {}, false, tempfile);
|
||||
@ -153,7 +153,7 @@ export class RepositoryManager {
|
||||
remote.url = urlParsed.href;
|
||||
|
||||
await fs.writeJSON(local, remote);
|
||||
|
||||
|
||||
this.repositories.set(remote.name, remote);
|
||||
return remote;
|
||||
}
|
||||
@ -185,7 +185,7 @@ export class RepositoryManager {
|
||||
|
||||
// Checking for version differences in the plugins
|
||||
// Get locally installed plugins
|
||||
let needsUpdates: IPluginManifest[] = [];
|
||||
const needsUpdates: IPluginManifest[] = [];
|
||||
for (const avail of this.plugins.availablePlugins) {
|
||||
const repoPlugin = this.repoProvidesPlugin(oprep, avail);
|
||||
if (repoPlugin) {
|
||||
@ -220,7 +220,7 @@ export class RepositoryManager {
|
||||
|
||||
public async loadFromFiles(): Promise<void> {
|
||||
const repos = await fs.readdir(this.env.repositoryPath);
|
||||
let loaded = [];
|
||||
const loaded = [];
|
||||
for (const rf of repos) {
|
||||
const file = path.join(this.env.repositoryPath, rf);
|
||||
try {
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { IPluginManifest } from "../plugin";
|
||||
|
||||
export interface IRepoPluginDef {
|
||||
name: string;
|
||||
version: string;
|
||||
@ -11,4 +9,4 @@ export interface IRepository {
|
||||
url: string;
|
||||
plugins: IRepoPluginDef[];
|
||||
schema: number;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user