Skip to content

[docs] secrets edit does not work on windows when $env:EDITOR has spaces #232

@serverhorror

Description

@serverhorror

When trying to edit files on Windows tailor doesn't accept the $env:EDITOR when the command has spaces, no shell/cmd parsing happens.

It would be nice to note that in the docs

Example:

tailor secrets edit foo.yaml
# Failed to edit file: Could not decrypt file: Reading key 'private.key' failed: invalid argument.
tailor secrets generate-key alice@example.invalid
# Public Key written to alice.key. This file can be committed.
# Private Key written to private.key. This file MUST NOT be committed.
tailor secrets edit foo.yaml
# Failed to edit file: Could not edit file: Please install 'code.exe -w' or set/change $EDITOR.
echo $env:EDITOR
code.exe -w

This works:

> cat $(where.exe codew.cmd)
@echo off

setlocal
REM Usually located in $env:LOCALAPPDATA\Programs\Microsoft VS Code\bin\code.cmd
code.cmd -w  %*
endlocal

Working session:

$env:EDITOR="codew.cmd"
tailor secrets edit foo.yaml
cat .\foo.yaml
user: alice=wcFMAySUogUAXelZARAAouVsMK85N3XNj+UlIATv...==

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions