Fix #117: add :version command

:version currently fills the command line with the version number in
order to display it to the user (hacky) and copies it to the clipboard.
This commit is contained in:
Oliver Blanthorn 2017-11-26 00:06:02 +00:00
parent 9e2c21123f
commit d65acf9f64
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 13 additions and 1 deletions

View file

@ -10,6 +10,6 @@ scripts/excmds_macros.py
scripts/newtab.md.sh
scripts/make_docs.sh &
webpack --display errors-only &
(webpack --display errors-only && scripts/git_version.sh)&
wait

5
scripts/git_version.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
version=$(git describe --tags)
sed -i 's/REPLACE_ME_WITH_THE_VERSION_USING_SED/'$version'/' ./build/background.js

View file

@ -511,6 +511,13 @@ export function suppress(preventDefault?: boolean, stopPropagation?: boolean) {
mode("ignore")
}
//#background
export function version(){
clipboard("yank","REPLACE_ME_WITH_THE_VERSION_USING_SED")
fillcmdline_notrail("REPLACE_ME_WITH_THE_VERSION_USING_SED")
}
/** Example:
- `mode ignore` to ignore all keys.
*/