@better-update/cli 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +21 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { spawn, spawnSync } from "node:child_process";
|
|
3
|
+
import { execFile, spawn, spawnSync } from "node:child_process";
|
|
4
4
|
import { defineCommand, runMain } from "citty";
|
|
5
5
|
import { Console, Context, Data, Deferred, Duration, Effect, Layer, Match, Option, ParseResult, Schema } from "effect";
|
|
6
6
|
import { Command, FetchHttpClient, FileSystem, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, HttpApiSecurity, HttpClient, HttpClientRequest, OpenApi, Path } from "@effect/platform";
|
|
@@ -20,6 +20,7 @@ import chalk from "chalk";
|
|
|
20
20
|
import os from "node:os";
|
|
21
21
|
import plistMod from "@expo/plist";
|
|
22
22
|
import { ExpoRunFormatter } from "@expo/xcpretty";
|
|
23
|
+
import { promisify } from "node:util";
|
|
23
24
|
import ignore from "ignore";
|
|
24
25
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
25
26
|
import { getFormattedSerialNumber, getX509Certificate, parsePKCS12 } from "@expo/pkcs12";
|
|
@@ -31,7 +32,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
31
32
|
|
|
32
33
|
//#endregion
|
|
33
34
|
//#region package.json
|
|
34
|
-
var version = "0.18.
|
|
35
|
+
var version = "0.18.2";
|
|
35
36
|
|
|
36
37
|
//#endregion
|
|
37
38
|
//#region src/lib/interactive-mode.ts
|
|
@@ -6599,6 +6600,7 @@ const detectPlatform = (explicit, config) => Effect.gen(function* () {
|
|
|
6599
6600
|
|
|
6600
6601
|
//#endregion
|
|
6601
6602
|
//#region src/lib/project-staging.ts
|
|
6603
|
+
const execFileAsync = promisify(execFile);
|
|
6602
6604
|
const LOCKFILES = [
|
|
6603
6605
|
["bun.lock", "bun"],
|
|
6604
6606
|
["bun.lockb", "bun"],
|
|
@@ -6685,6 +6687,22 @@ const copyProjectTree = (params) => Effect.tryPromise({
|
|
|
6685
6687
|
},
|
|
6686
6688
|
catch: (cause) => new StagingError({ message: `Failed to copy project to staging dir: ${formatCause(cause)}` })
|
|
6687
6689
|
});
|
|
6690
|
+
/**
|
|
6691
|
+
* EAS stages projects via `git clone`, so `.git` is always present and prepare
|
|
6692
|
+
* scripts that shell out to git (lefthook install, husky install,
|
|
6693
|
+
* simple-git-hooks, etc.) succeed naturally. Our copy strips `.git` for size,
|
|
6694
|
+
* so we recreate a bare repo at the staging root before install runs. The
|
|
6695
|
+
* hooks installed here never fire because no one commits in the staging dir —
|
|
6696
|
+
* they exist only so `git rev-parse` succeeds during postinstall.
|
|
6697
|
+
*/
|
|
6698
|
+
const initGitRepo = (stagingRoot) => Effect.tryPromise({
|
|
6699
|
+
try: async () => execFileAsync("git", [
|
|
6700
|
+
"init",
|
|
6701
|
+
"-q",
|
|
6702
|
+
stagingRoot
|
|
6703
|
+
]),
|
|
6704
|
+
catch: (cause) => new StagingError({ message: `Failed to init git repo in staging dir: ${formatCause(cause)}` })
|
|
6705
|
+
}).pipe(Effect.asVoid);
|
|
6688
6706
|
const runInstall = (params) => runStep({
|
|
6689
6707
|
command: params.packageManager,
|
|
6690
6708
|
args: ["install"],
|
|
@@ -6709,6 +6727,7 @@ const prepareStagingProject = (input) => Effect.gen(function* () {
|
|
|
6709
6727
|
dest: stagingRoot,
|
|
6710
6728
|
ig: yield* buildIgnoreInstance(workspaceRoot)
|
|
6711
6729
|
});
|
|
6730
|
+
yield* initGitRepo(stagingRoot);
|
|
6712
6731
|
yield* runInstall({
|
|
6713
6732
|
stagingRoot,
|
|
6714
6733
|
packageManager,
|