Skip to content

Commit 2ec1bdf

Browse files
Switch .comfy_environment value convention from underscores to dashes (#462)
'local_desktop2_standalone' -> 'local-desktop2-standalone'. Pairs with the same convention shift on the ComfyUI side (Comfy-Org/ComfyUI#13425). Dashes are easier to type and more conventional in HTTP-header-adjacent identifiers. Amp-Thread-ID: https://ampcode.com/threads/T-019df26e-96f4-7518-94da-0e4263680e3c Co-authored-by: Amp <amp@ampcode.com>
1 parent dd70f8d commit 2ec1bdf

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/sources/standalone/envPaths.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ vi.mock('electron', () => ({
1010
import { writeComfyEnvironment } from './envPaths'
1111

1212
const ENV_FILENAME = '.comfy_environment'
13-
const EXPECTED_CONTENT = 'local_desktop2_standalone\n'
13+
const EXPECTED_CONTENT = 'local-desktop2-standalone\n'
1414

1515
describe('writeComfyEnvironment', () => {
1616
let tmpDir: string
@@ -23,7 +23,7 @@ describe('writeComfyEnvironment', () => {
2323
try { fs.rmSync(tmpDir, { recursive: true, force: true }) } catch {}
2424
})
2525

26-
it('writes the marker file with local_desktop2_standalone content + trailing newline', async () => {
26+
it('writes the marker file with local-desktop2-standalone content + trailing newline', async () => {
2727
await writeComfyEnvironment(tmpDir)
2828
const written = fs.readFileSync(path.join(tmpDir, ENV_FILENAME), 'utf-8')
2929
expect(written).toBe(EXPECTED_CONTENT)

src/main/sources/standalone/envPaths.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ export function getMasterPythonPath(installPath: string): string {
5656
}
5757

5858
const COMFY_ENVIRONMENT_FILE = '.comfy_environment'
59-
const COMFY_ENVIRONMENT_VALUE = 'local_desktop2_standalone'
59+
const COMFY_ENVIRONMENT_VALUE = 'local-desktop2-standalone'
6060
const COMFY_ENVIRONMENT_CONTENT = COMFY_ENVIRONMENT_VALUE + '\n'
6161

6262
/**
6363
* Write the `.comfy_environment` marker file consumed by ComfyUI core
6464
* (see Comfy-Org/ComfyUI#13425) so partner-node API requests carry the
65-
* `X-Comfy-Env: local_desktop2_standalone` header. Idempotent: if the file already
65+
* `X-Comfy-Env: local-desktop2-standalone` header. Idempotent: if the file already
6666
* has the expected content, this is a no-op. Skips silently when the
6767
* target directory does not exist (older installs not yet migrated).
6868
* Errors are swallowed with a warning — this marker is non-critical and

0 commit comments

Comments
 (0)