~timharek/sbanken.sh

64811abc87f9af37cfd8cc22e70c49383c4ef80e — Tim Hårek Andreassen 2 years ago d7945e2
Move config to `$XDG_CONFIG_HOME`

Signed-off-by: Tim Hårek Andreassen <tim@harek.dev>
3 files changed, 5 insertions(+), 3 deletions(-)

M README.md
R .env.example => config.example
M sbanken.sh
M README.md => README.md +3 -1
@@ 8,7 8,7 @@ Inspired by [Sbanken's example](https://github.com/Sbanken/api-examples/blob/mas

### Environment variables

1. Copy `.env.example`: `cp .env.example .env`
1. Copy `config.example` to your `$XDG_CONFIG_HOME`: `cp config.example $XDG_CONFIG_HOME/sbanken/config`
2. Update the variables with your own credentials

## Usage


@@ 17,3 17,5 @@ Inspired by [Sbanken's example](https://github.com/Sbanken/api-examples/blob/mas
chmod +x sbanken.sh
./sbanken.sh -h # for help
```

PS: You can also add the `sbanken.sh` to your `$PATH` and run it from anywhere.

R .env.example => config.example +0 -0
M sbanken.sh => sbanken.sh +2 -2
@@ 1,8 1,8 @@
#!/bin/bash

getToken() {
  source ~/repos/sbanken.sh/.env
source $XDG_CONFIG_HOME/sbanken/config

getToken() {
  acceptHeader='Accept: application/json'
  contentTypeHeader='Content-Type: application/x-www-form-urlencoded; charset=utf-8'