This commit is contained in:
Evert Prants 2020-11-28 22:27:05 +02:00
parent 7ee67544e5
commit a86b912520
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
6 changed files with 15 additions and 14 deletions

3
.npmignore Normal file
View File

@ -0,0 +1,3 @@
/src/
/tsconfig.json
/tslint.json

View File

@ -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",

View File

@ -49,7 +49,7 @@ export class PluginManager {
}
public getLoaded(): IPlugin[] {
const list = []
const list = [];
for (const pl of this.plugins.values()) {
list.push(pl);
}

View File

@ -1,2 +1,2 @@
export * from './manager';
export * from './repository';
export * from './repository';

View File

@ -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 {

View File

@ -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;
}
}