From 5b66bc15d2e660fc046a57c89d4ce25cda01b0a8 Mon Sep 17 00:00:00 2001 From: Pauline Date: Sun, 8 Sep 2024 19:02:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20remove=20lockfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pauline --- packages/scripts/prepare.ts | 10 +--------- packages/scripts/utils/patch.ts | 8 -------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/packages/scripts/prepare.ts b/packages/scripts/prepare.ts index 6cc458f0..3d99e0b6 100644 --- a/packages/scripts/prepare.ts +++ b/packages/scripts/prepare.ts @@ -1,15 +1,12 @@ -import fs from 'node:fs'; import { readFile, writeFile } from 'node:fs/promises'; import { consola } from 'consola'; import mustache from 'mustache'; -import { join, resolve } from 'pathe'; +import { join } from 'pathe'; import { checkEnvironment, which } from './utils'; import { getTriple } from './utils/triple'; const env = checkEnvironment(import.meta); const triple = getTriple(); -const PREPARE_LOCK_VERSION = '1'; -const prepareLockPath = resolve(join(env.__deps, 'prepare_lock')); if ((await Promise.all([which`cargo`, which`rustc`, which`pnpm`])).some(f => !f)) consola.error( @@ -26,10 +23,6 @@ if ((await Promise.all([which`cargo`, which`rustc`, which`pnpm`])).some(f => !f) consola.info('generating cargo configuration file.'); -if (fs.existsSync(prepareLockPath)) - if (fs.readFileSync(prepareLockPath, 'utf-8') === PREPARE_LOCK_VERSION) - env.__exit(0); - interface ConfigStore { isWin: boolean; isMacOS: boolean; @@ -66,7 +59,6 @@ try { const template = await readFile(join(env.__root, '.cargo', 'config.toml.mustache'), { encoding: 'utf8' }); const rendered = mustache.render(template, configStore).replace(/\n{2,}/g, '\n'); await writeFile(join(env.__root, '.cargo', 'config.toml'), rendered, { mode: 0o751, flag: 'w+', encoding: 'utf-8' }); - await writeFile(join(env.__deps, 'prepare_lock'), PREPARE_LOCK_VERSION, 'utf-8'); } catch (error) { consola.error(` diff --git a/packages/scripts/utils/patch.ts b/packages/scripts/utils/patch.ts index 4c0af1f8..c44dc23f 100644 --- a/packages/scripts/utils/patch.ts +++ b/packages/scripts/utils/patch.ts @@ -1,4 +1,3 @@ -import { existsSync, readFileSync } from 'node:fs'; import fs from 'node:fs/promises'; import { type } from 'node:os'; import process from 'node:process'; @@ -8,8 +7,6 @@ import { join, resolve } from 'pathe'; import semver from 'semver'; import type { CheckedEnvironment } from '.'; -const UPDATEKEY_LOCK_VERSION = '1'; - export async function tauriUpdateKey(env: CheckedEnvironment): Promise { if (process.env.TAURI_SIGNING_PRIVATE_KEY) return; @@ -18,10 +15,6 @@ export async function tauriUpdateKey(env: CheckedEnvironment): Promise Promise.all([ fs.readFile(publicKeyPath, 'utf-8'), fs.readFile(privateKeyPath, 'utf-8'), @@ -48,7 +41,6 @@ export async function tauriUpdateKey(env: CheckedEnvironment): Promise