out-of-cheese-error / the-way

A code snippets manager for your terminal.
MIT License
352 stars 16 forks source link

Don't put access token into global configuration #132

Closed DrSensor closed 2 years ago

DrSensor commented 2 years ago

This is bad because I can't track ~/.config/the-way/the-way.toml into my dotfiles repo. I want to track it because it contain theme and copy_cmd field which can be different depend on my current machine setup.

I usually wrap every command that require credential into separate function and use pass to manage those credential. For example: (in fish)

alias snippet the-way
function snippet\ sync -d "sync commands saved as snippet into GitHub Gist"
  THE_WAY_GITHUB_TOKEN=(pass gist.github.com/token) snippet sync $argv
end

Currently, the-way sync command put github_access_token into global config regardless the environment variable is supplied or not.

Ninjani commented 2 years ago

Good point, added to the next release