git-stack-cli 1.11.1 → 1.11.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.
@@ -30056,6 +30056,45 @@ GitReviseTodo.todo = function todo(args) {
30056
30056
  GitReviseTodo.execute = async function grt_execute(args) {
30057
30057
  // generate temporary directory and drop sequence editor script
30058
30058
  const tmp_git_sequence_editor_path = path.join(os.tmpdir(), "git-sequence-editor.sh");
30059
+ // replaced at build time with literal contents of `scripts/git-sequence-editor.sh`
30060
+ const GIT_SEQUENCE_EDITOR_SCRIPT = `#!/bin/sh
30061
+
30062
+ # Example
30063
+ #
30064
+ # GIT_REVISE_TODO="abc" GIT_EDITOR="$(pwd)/scripts/git-sequence-editor.sh" git revise --edit -i head~4
30065
+ #
30066
+ # Note
30067
+ # ----------------
30068
+ # Use \`GIT_EDITOR\` above instead of \`GIT_SEQUENCE_EDITOR\` because \`git revise\` does not use
30069
+ # \`GIT_SEQUENCE_EDITOR\` when passing the \`--edit\` flag, but does work without the \`--edit\` flag
30070
+ #
30071
+ #
30072
+
30073
+ # debug print env variables
30074
+ echo "GIT_REVISE_TODO=$GIT_REVISE_TODO"
30075
+ echo "CLI=$0 $*"
30076
+ echo "PWD=$(pwd)"
30077
+
30078
+ # ensure \`GIT_REVISE_TODO\` is not empty
30079
+ if [ -z "$GIT_REVISE_TODO" ]; then
30080
+ echo "🚨 GIT_REVISE_TODO environment variable is empty" >&2
30081
+ exit 1
30082
+ fi
30083
+
30084
+ # first argument into git sequence editor is git-revise-todo file
30085
+ git_revise_todo_path="$1"
30086
+
30087
+ # debug print git-revise-todo file passed into command
30088
+ echo "$git_revise_todo_path"
30089
+ echo "----- START -----"
30090
+ cat "$git_revise_todo_path"
30091
+ echo "------ END ------"
30092
+
30093
+ # write content of \`GIT_REVISE_TODO\` env variable to \`git_revise_todo_path\`
30094
+ echo "$GIT_REVISE_TODO" > "$git_revise_todo_path"
30095
+ `;
30096
+ // write script to temporary path
30097
+ fs.writeFileSync(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
30059
30098
  // ensure script is executable
30060
30099
  fs.chmodSync(tmp_git_sequence_editor_path, "755");
30061
30100
  const git_revise_todo = GitReviseTodo(args);
@@ -30778,50 +30817,6 @@ async function run$5() {
30778
30817
  async function rebase_git_revise() {
30779
30818
  actions.debug(`rebase_git_revise`);
30780
30819
  actions.output(reactExports.createElement(Text, { color: colors.yellow, wrap: "truncate-end" }, "Rebasing\u2026"));
30781
- // generate temporary directory and drop sequence editor script
30782
- const tmp_git_sequence_editor_path = path.join(os.tmpdir(), "git-sequence-editor.sh");
30783
- actions.debug(`tmp_git_sequence_editor_path=${tmp_git_sequence_editor_path}`);
30784
- // replaced at build time with literal contents of `scripts/git-sequence-editor.sh`
30785
- const GIT_SEQUENCE_EDITOR_SCRIPT = `#!/bin/sh
30786
-
30787
- # Example
30788
- #
30789
- # GIT_REVISE_TODO="abc" GIT_EDITOR="$(pwd)/scripts/git-sequence-editor.sh" git revise --edit -i head~4
30790
- #
30791
- # Note
30792
- # ----------------
30793
- # Use \`GIT_EDITOR\` above instead of \`GIT_SEQUENCE_EDITOR\` because \`git revise\` does not use
30794
- # \`GIT_SEQUENCE_EDITOR\` when passing the \`--edit\` flag, but does work without the \`--edit\` flag
30795
- #
30796
- #
30797
-
30798
- # debug print env variables
30799
- echo "GIT_REVISE_TODO=$GIT_REVISE_TODO"
30800
- echo "CLI=$0 $*"
30801
- echo "PWD=$(pwd)"
30802
-
30803
- # ensure \`GIT_REVISE_TODO\` is not empty
30804
- if [ -z "$GIT_REVISE_TODO" ]; then
30805
- echo "🚨 GIT_REVISE_TODO environment variable is empty" >&2
30806
- exit 1
30807
- fi
30808
-
30809
- # first argument into git sequence editor is git-revise-todo file
30810
- git_revise_todo_path="$1"
30811
-
30812
- # debug print git-revise-todo file passed into command
30813
- echo "$git_revise_todo_path"
30814
- echo "----- START -----"
30815
- cat "$git_revise_todo_path"
30816
- echo "------ END ------"
30817
-
30818
- # write content of \`GIT_REVISE_TODO\` env variable to \`git_revise_todo_path\`
30819
- echo "$GIT_REVISE_TODO" > "$git_revise_todo_path"
30820
- `;
30821
- // write script to temporary path
30822
- fs.writeFileSync(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
30823
- // ensure script is executable
30824
- fs.chmodSync(tmp_git_sequence_editor_path, "755");
30825
30820
  // create temporary branch
30826
30821
  await cli(`git checkout -b ${temp_branch_name}`);
30827
30822
  await GitReviseTodo.execute({
@@ -37385,7 +37380,7 @@ async function command() {
37385
37380
  .wrap(123)
37386
37381
  // disallow unknown options
37387
37382
  .strict()
37388
- .version("1.11.1" )
37383
+ .version("1.11.2" )
37389
37384
  .showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
37390
37385
  .help("help", "Show usage via `git stack help`")
37391
37386
  .argv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "1.11.1",
3
+ "version": "1.11.2",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -1,8 +1,6 @@
1
1
  import * as React from "react";
2
2
 
3
3
  import fs from "node:fs";
4
- import os from "node:os";
5
- import path from "node:path";
6
4
 
7
5
  import * as Ink from "ink-cjs";
8
6
  import cloneDeep from "lodash/cloneDeep";
@@ -145,25 +143,6 @@ async function run() {
145
143
  </Ink.Text>
146
144
  );
147
145
 
148
- // generate temporary directory and drop sequence editor script
149
- const tmp_git_sequence_editor_path = path.join(
150
- os.tmpdir(),
151
- "git-sequence-editor.sh"
152
- );
153
-
154
- actions.debug(
155
- `tmp_git_sequence_editor_path=${tmp_git_sequence_editor_path}`
156
- );
157
-
158
- // replaced at build time with literal contents of `scripts/git-sequence-editor.sh`
159
- const GIT_SEQUENCE_EDITOR_SCRIPT = `process.env.GIT_SEQUENCE_EDITOR_SCRIPT`;
160
-
161
- // write script to temporary path
162
- fs.writeFileSync(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
163
-
164
- // ensure script is executable
165
- fs.chmodSync(tmp_git_sequence_editor_path, "755");
166
-
167
146
  // create temporary branch
168
147
  await cli(`git checkout -b ${temp_branch_name}`);
169
148
 
@@ -116,6 +116,12 @@ GitReviseTodo.execute = async function grt_execute(args: ExecuteArgs) {
116
116
  "git-sequence-editor.sh"
117
117
  );
118
118
 
119
+ // replaced at build time with literal contents of `scripts/git-sequence-editor.sh`
120
+ const GIT_SEQUENCE_EDITOR_SCRIPT = `process.env.GIT_SEQUENCE_EDITOR_SCRIPT`;
121
+
122
+ // write script to temporary path
123
+ fs.writeFileSync(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
124
+
119
125
  // ensure script is executable
120
126
  fs.chmodSync(tmp_git_sequence_editor_path, "755");
121
127