@pmate/cli 0.29.8 → 0.29.10

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -4
  2. package/package.json +17 -10
package/dist/index.js CHANGED
@@ -19374,15 +19374,18 @@ var ServiceRuntimeRunner = class {
19374
19374
  const gitUrl = this.withToken(repoUrl);
19375
19375
  const scriptPath = script.startsWith("/") || script.startsWith("./") ? script : `./${script}`;
19376
19376
  const envName = options.envName ?? "prod";
19377
- const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName, server);
19377
+ const envSyncCommand = server === "local" ? void 0 : await this.buildScriptEnvSyncCommand(service.id, envName, server);
19378
19378
  const command = [
19379
19379
  `cd "$HOME"`,
19380
19380
  `[ -d "${repoDir}/.git" ] || git clone "${gitUrl}" "${repoDir}"`,
19381
19381
  `cd "${repoDir}"`,
19382
19382
  `if [ -f ~/.profile ]; then . ~/.profile; fi`,
19383
19383
  `if [ -f ~/.bashrc ]; then . ~/.bashrc; fi`,
19384
- `if [ -n "$(git status --porcelain)" ]; then git reset --hard HEAD; git clean -fd; fi`,
19385
- `git pull --rebase`,
19384
+ ...server === "local" ? [
19385
+ `test "$(git branch --show-current)" = main || { echo 'Local service checkout must be on main' >&2; exit 1; }`,
19386
+ `test -z "$(git status --porcelain)" || { echo 'Local service checkout has uncommitted changes; refusing to discard them' >&2; exit 1; }`,
19387
+ `git pull --ff-only origin main`
19388
+ ] : [`if [ -n "$(git status --porcelain)" ]; then git reset --hard HEAD; git clean -fd; fi`, `git pull --rebase`],
19386
19389
  ...envSyncCommand ? [envSyncCommand] : [],
19387
19390
  `"${scriptPath}" restart --env ${shellQuote2(envName)}`
19388
19391
  ].join(" && ");
@@ -19406,7 +19409,7 @@ var ServiceRuntimeRunner = class {
19406
19409
  const repoDir = this.getRepoDirName(repository);
19407
19410
  const scriptPath = script.startsWith("/") || script.startsWith("./") ? script : `./${script}`;
19408
19411
  const envName = options.envName ?? "prod";
19409
- const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName, server);
19412
+ const envSyncCommand = server === "local" ? void 0 : await this.buildScriptEnvSyncCommand(service.id, envName, server);
19410
19413
  const command = [
19411
19414
  `cd "$HOME"`,
19412
19415
  `cd "${repoDir}"`,
@@ -20255,6 +20258,7 @@ var ServiceRuntimeRunner = class {
20255
20258
  });
20256
20259
  }
20257
20260
  runRemoteCommand(server, command) {
20261
+ if (server === "local") return this.runCommandWithEnv("bash", ["-c", command], import_node_os10.default.homedir());
20258
20262
  return new Promise((resolve, reject) => {
20259
20263
  const target = `pmate@${server}`;
20260
20264
  const child = (0, import_node_child_process10.spawn)("ssh", buildSshBashArgs(target, command), { stdio: "inherit" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.29.8",
3
+ "version": "0.29.10",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -11,6 +11,16 @@
11
11
  "files": [
12
12
  "dist"
13
13
  ],
14
+ "scripts": {
15
+ "build": "npm run clean && tsup --config tsup.config.ts && node scripts/copy-templates.js",
16
+ "clean": "rimraf dist",
17
+ "dev": "ts-node src/index.ts",
18
+ "release": "pnpm publish",
19
+ "start": "node dist/index.js",
20
+ "test": "vitest run src/tests",
21
+ "typecheck": "tsc --noEmit",
22
+ "prepare": "npm run build"
23
+ },
14
24
  "keywords": [
15
25
  "cli",
16
26
  "typescript",
@@ -57,13 +67,10 @@
57
67
  "typescript": "^5.9.3",
58
68
  "vitest": "^4.0.17"
59
69
  },
60
- "scripts": {
61
- "build": "npm run clean && tsup --config tsup.config.ts && node scripts/copy-templates.js",
62
- "clean": "rimraf dist",
63
- "dev": "ts-node src/index.ts",
64
- "release": "pnpm publish",
65
- "start": "node dist/index.js",
66
- "test": "vitest run src/tests",
67
- "typecheck": "tsc --noEmit"
70
+ "pnpm": {
71
+ "overrides": {
72
+ "@pmate/meta": "^1.3.1",
73
+ "@pmate/utils": "^1.1.4"
74
+ }
68
75
  }
69
- }
76
+ }