Shemnei / punktf

⚡ A cross-platform multi-target dotfiles manager

Home Page:https://shemnei.github.io/punktf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deployment fails if `PUNKTF_TARGET` environment variable is not set

Shemnei opened this issue · comments

Crashes even though target is set in the profile and given as a cli argument.

punktf -v --source . deploy $PROFILE --target . --dry-run
[2021-08-20T17:12:19Z DEBUG punktf] Parsed Opts:
    Opts {
        shared: Shared {
            source: SourcePath(
                ".",
            ),
            verbose: 1,
        },
        command: Deploy(
            Deploy {
                profile: "linux_arch_archx",
                target: Some(
                    ".",
                ),
                dry_run: true,
            },
        ),
    }
The application panicked (crashed).
Message:  No environment variable `PUNKTF_TARGET` set. Either set this variable, use the `-t/--target`
				argument or use the profile attribute `target`.

A fix for now is to just set the environment variable. As it has the lowest priority it wont actually be used if another way of specifying a target is used (e.g. profile.target, cli -t/--target).

An unix bases systems, this can be used instead of permanently setting a environment variable:

export PUNKTF_TARGET=/dev/null
punktf ...

# OR

PUNKTF_TARGET=/dev/null punktf ...

Will be released with 1.0.1