Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.6] - 2026-06-12

### Fixed

- `action-runner.bat` now runs `cd /d "%~dp0"` before invoking Node, so CLI aliases work from any terminal working directory (matching Run Now spawn behavior).

## [1.0.5] - 2026-06-12

### Fixed
Expand Down
57 changes: 57 additions & 0 deletions command-lib/tests/actionRunnerBat.integration.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const { describe, it } = require("node:test");
const assert = require("node:assert/strict");
const { spawnSync } = require("node:child_process");
const fs = require("node:fs");
const os = require("node:os");
const path = require("node:path");

const repoRoot = path.resolve(__dirname, "..", "..");
const isWindows = process.platform === "win32";
const actionRunnerBatPath = path.join(
repoRoot,
"commands",
"action-runner",
"action-runner.bat",
);
const missingActionName = "shellforge-nonexistent-action-for-test";

function runActionRunnerBatFromDirectory(workingDirectory, environmentVariables = {}) {
return spawnSync("cmd.exe", ["/c", actionRunnerBatPath, `--action=${missingActionName}`], {
cwd: workingDirectory,
encoding: "utf8",
windowsHide: true,
env: {
...process.env,
...environmentVariables,
},
});
}

function createTempDirectory() {
return fs.mkdtempSync(path.join(os.tmpdir(), "shellforge-action-runner-bat-"));
}

const describeWindows = isWindows ? describe : describe.skip;

describeWindows("action-runner.bat integration", () => {
it("runs from an arbitrary working directory and reaches the Action Runner runtime", () => {
const unrelatedWorkingDirectory = createTempDirectory();

const executionResult = runActionRunnerBatFromDirectory(unrelatedWorkingDirectory, {
SHELLFORGE_USER_DATA: repoRoot,
});

const combinedOutput = `${executionResult.stdout}\n${executionResult.stderr}`;

assert.notEqual(
executionResult.status,
0,
"Expected a non-zero exit code for a missing action name.",
);
assert.match(
combinedOutput,
/\[Action Runner\]|Missing Configuration/,
"Expected Action Runner output when the bat starts Node from an unrelated cwd.",
);
});
});
1 change: 1 addition & 0 deletions commands/action-runner/action-runner.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@echo off
cd /d "%~dp0"
setlocal enabledelayedexpansion

set JS_FILE="%~dp0\action-runner.js"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shellforge",
"version": "1.0.5",
"version": "1.0.6",
"description": "ShellForge - custom Windows PowerShell automation and commands",
"license": "ISC",
"author": "João Luiz de Castro",
Expand Down
4 changes: 2 additions & 2 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shellforge-ui",
"version": "1.0.5",
"version": "1.0.6",
"description": "ShellForge desktop manager for Windows PowerShell automation",
"author": "João Luiz de Castro",
"private": true,
Expand Down
Loading