diff options
author | sharkdp <davidpeter@web.de> | 2018-05-16 21:22:16 +0200 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2018-05-16 22:04:12 +0200 |
commit | 145b99f01c19416b5d6419d6bcf3d51a771a5518 (patch) | |
tree | fa1471ca33db25e077bc421355b1c8e17c57fa9c /assets/create.sh | |
parent | 9af1d2b8917710e3c2ce0a591af5f8bdd0101635 (diff) |
Include syntaxes and themes in repository
This changes a few things:
- All syntaxes and themes are now stored (as submodules) under
assets/syntaxes and assets/themes
- The default directories for syntaxes and themes are "syntaxes"
and "themes" (used to be "syntax" and "themes")
- The "bat cache" command can now take a `--source <dir>` and
`--target <dir>` option.
- The cached files have been renamed to "themes.bin" and "syntaxes.bin"
Diffstat (limited to 'assets/create.sh')
-rw-r--r-- | assets/create.sh | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/assets/create.sh b/assets/create.sh index 8b20316c..466d382c 100644 --- a/assets/create.sh +++ b/assets/create.sh @@ -1,37 +1,11 @@ -set -e +#!/bin/bash -THEME_FOLDER="$HOME/.config/bat/themes" -SYNTAX_FOLDER="$HOME/.config/bat/syntax" +ASSET_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ ! -e "$THEME_FOLDER" ]; then - mkdir -p "$THEME_FOLDER" - ( - cd "$THEME_FOLDER" - git clone https://github.com/jonschlinkert/sublime-monokai-extended - ln -s "sublime-monokai-extended/Monokai Extended.tmTheme" Default.tmTheme - ) -fi +DEFAULT_MARKDOWN_SYNTAX="$ASSET_DIR/syntaxes/Packages/Markdown" -if [ ! -e "$SYNTAX_FOLDER" ]; then - mkdir -p "$SYNTAX_FOLDER" - ( - cd "$SYNTAX_FOLDER" - git clone https://github.com/sublimehq/Packages/ +rm -rf "$DEFAULT_MARKDOWN_SYNTAX" - # Patch JavaScript syntax - sed -i -e 's/{{identifier_break}}+/{{identifier_break}}/' Packages/JavaScript/JavaScript.sublime-syntax +bat cache --init --source="$ASSET_DIR" --target="$ASSET_DIR" - # Use extended Markdown syntax - rm -rf Packages/Markdown - git clone https://github.com/jonschlinkert/sublime-markdown-extended - - # Add additional sxntax definitions - git clone https://github.com/princemaple/elixir-sublime-syntax/ - git clone https://github.com/sharkdp/sublime_toml_highlighting - git clone https://github.com/JuliaEditorSupport/Julia-sublime - ) -fi - -bat cache --init - -cp "$HOME/.cache/bat"/* . +git -C "$ASSET_DIR/syntaxes/Packages" checkout "$DEFAULT_MARKDOWN_SYNTAX" |