19 Commits

Author SHA1 Message Date
Alexey Alekhin
7b5223f5c1 Changed max-wait parameter type to float64 2016-05-15 20:18:00 +02:00
Marcin Kulik
7a5e25e846 Look for $XDG_CONFIG_HOME/asciinema/config instead of $XDG_CONFIG_HOME/.asciinema/config 2015-05-23 18:30:43 +02:00
Zhiming Wang
fd38b0f453 check a list of locations for the config file
* First, check the following locations in order (skip if the
  corresponding environment variable is undefined or empty):

  * `$ASCIINEMA_CONFIG_HOME/config`
  * `$XDG_CONFIG_HOME/asciinema/config`
  * `$HOME/.config/asciinema/config`
  * `$HOME/.asciinema/config`

  Use the first one that is found.

* If not found, create a new config file at the first location listed
  above whose corresponding environment variable is nonempty; i.e.,

  * Use `$ASCIINEMA_CONFIG_HOME/config` if `ASCIINEMA_CONFIG_HOME` is
    nonempty;
  * Next, use `$XDG_CONFIG_HOME/asciinema/config` if `XDG_CONFIG_HOME`
  is nonempty;
  * Finally, use `$HOME/.config/asciinema/config` if `HOME` is nonempty.

* If none of the above works, exit with error `"Need $HOME"`.
2015-05-23 04:28:18 -07:00
Marcin Kulik
07d70371ed Rename config section from [playback] to [play] 2015-05-10 13:50:43 +02:00
Yann Ramin
a822f0f46a gofmt 2015-05-06 07:48:57 -07:00
Yann Ramin
56133eb33a New config option, check for default value 2015-05-06 07:48:27 -07:00
Marcin Kulik
1ef9b16d3d Refactor config loading 2015-03-12 12:50:28 +01:00
Marcin Kulik
7243568f4f Separate config file representation from configuration 2015-03-12 12:23:29 +01:00
Marcin Kulik
fa3b4cd8fa Access process env only from entrypoint 2015-03-11 12:07:26 +01:00
Marcin Kulik
48571326e9 Allow setting -w and -y in config file 2015-03-09 16:44:15 +01:00
Marcin Kulik
ce34fede05 Support old location of API token in config file 2015-03-08 11:51:30 +01:00
Marcin Kulik
d095e808b0 Simplify config loading wrt API URL 2015-03-05 16:30:55 +01:00
Marcin Kulik
2578e5b5ed Update paths due to repo renaming 2015-03-05 15:57:12 +01:00
Marcin Kulik
5821a4c4bb Vendor all deps 2015-03-03 13:00:17 +01:00
Marcin Kulik
41d1d71ab6 Implement golint suggestions 2014-11-15 13:33:20 +01:00
Marcin Kulik
b872658550 No need for ConfigLoader interface 2014-11-13 20:46:00 +01:00
Marcin Kulik
51e989ec0a Create ~/.asciinema dir before writing config file 2014-11-13 20:45:59 +01:00
Marcin Kulik
63a276bb42 Don't rely on user.Current - it fails on cross compiled binaries 2014-11-13 20:45:59 +01:00
Marcin Kulik
16bb6fb016 Add CLI runner 2014-11-13 20:45:05 +01:00