fix problems with new package versions
This commit is contained in:
parent
e50b5c2e78
commit
e703b0b4fe
5 changed files with 20 additions and 687 deletions
|
@ -28,7 +28,6 @@
|
|||
"@types/tar": "^6.1.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
||||
"@typescript-eslint/parser": "^5.48.1",
|
||||
"@yarnpkg/sdks": "3.0.0-rc.35",
|
||||
"eslint": "^8.31.0",
|
||||
"pkg": "^5.8.0",
|
||||
"typescript": "^4.9.4"
|
||||
|
|
681
pnpm-lock.yaml
681
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,7 @@
|
|||
import chalk from 'chalk';
|
||||
import fs from 'fs-extra';
|
||||
import * as lowdb from 'lowdb';
|
||||
import { Low } from 'lowdb';
|
||||
import { JSONFile, TextFile } from 'lowdb/node';
|
||||
import crypto from 'node:crypto';
|
||||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
|
@ -48,8 +49,8 @@ export default class Install {
|
|||
const getWahInfo = parseWahInfo(readWahInfo.toString());
|
||||
|
||||
const dbFile = `${this.options.sysroot}/var/lib/wahpkg/pkgs.json`;
|
||||
const adapter = new lowdb.JSONFile<dbData>(dbFile);
|
||||
const db = new lowdb.Low(adapter);
|
||||
const adapter = new JSONFile<dbData>(dbFile);
|
||||
const db = new Low(adapter);
|
||||
|
||||
await db.read();
|
||||
|
||||
|
@ -66,7 +67,7 @@ export default class Install {
|
|||
|
||||
await fs.mkdirp(`${this.options.sysroot}/var/lib/wahpkg/pkgs/${getWahInfo.name}`);
|
||||
await fs.writeFile(`${this.options.sysroot}/var/lib/wahpkg/pkgs/${getWahInfo.name}/MD5HASHES`, '');
|
||||
const md5Adapter = new lowdb.TextFile(`${this.options.sysroot}/var/lib/wahpkg/pkgs/${getWahInfo.name}/MD5HASHES`);
|
||||
const md5Adapter = new TextFile(`${this.options.sysroot}/var/lib/wahpkg/pkgs/${getWahInfo.name}/MD5HASHES`);
|
||||
|
||||
await md5Adapter.read();
|
||||
|
||||
|
@ -81,7 +82,7 @@ export default class Install {
|
|||
|
||||
await md5Adapter.write(toWriteToFile);
|
||||
|
||||
await fs.copy(path.join(makeExtractDir, 'ROOT'), path.join(this.options.sysroot), { overwrite: true, dereference: false, preserveTimestamps: true, recursive: true });
|
||||
await fs.copy(path.join(makeExtractDir, 'ROOT'), path.join(this.options.sysroot), { overwrite: true, dereference: false, preserveTimestamps: true });
|
||||
await fs.rm(path.join(makeExtractDir), { recursive: true, force: true });
|
||||
|
||||
console.log(chalk.bold.green`Package %s has been installed!`, getWahInfo.name);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import * as lowdb from 'lowdb';
|
||||
import { Low } from 'lowdb';
|
||||
import { JSONFile } from 'lowdb/node';
|
||||
|
||||
import { GlobalOptions } from '../index.js';
|
||||
import { makeDbFile } from '../utils.js';
|
||||
|
@ -15,8 +16,8 @@ export default class List {
|
|||
await makeDbFile(this.options.sysroot);
|
||||
|
||||
const dbFile = `${this.options.sysroot}/var/lib/wahpkg/pkgs.json`;
|
||||
const adapter = new lowdb.JSONFile<dbData>(dbFile);
|
||||
const db = new lowdb.Low(adapter);
|
||||
const adapter = new JSONFile<dbData>(dbFile);
|
||||
const db = new Low(adapter);
|
||||
|
||||
await db.read();
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import chalk from 'chalk';
|
||||
import fs from 'fs-extra';
|
||||
import * as lowdb from 'lowdb';
|
||||
import { Low } from 'lowdb';
|
||||
import { JSONFile } from 'lowdb/node';
|
||||
import crypto from 'node:crypto';
|
||||
import path from 'node:path';
|
||||
import { lock, unlock } from 'proper-lockfile';
|
||||
|
@ -25,8 +26,8 @@ export default class Uninstall {
|
|||
await lock(`${this.options.sysroot}/var/lib/wahpkg`, { lockfilePath: `${this.options.sysroot}/var/lib/wahpkg/wahpkg.lock` });
|
||||
|
||||
const dbFile = `${this.options.sysroot}/var/lib/wahpkg/pkgs.json`;
|
||||
const adapter = new lowdb.JSONFile<dbData>(dbFile);
|
||||
const db = new lowdb.Low(adapter);
|
||||
const adapter = new JSONFile<dbData>(dbFile);
|
||||
const db = new Low(adapter);
|
||||
|
||||
await db.read();
|
||||
|
||||
|
|
Reference in a new issue