Compare commits

...

3 Commits

3 changed files with 12 additions and 14 deletions

View File

@@ -31,9 +31,14 @@ return { -- Add the community repository of plugin specific
{ import = "astrocommunity.editing-support.todo-comments-nvim" }, { import = "astrocommunity.editing-support.todo-comments-nvim" },
{ import = "astrocommunity.indent.mini-indentscope" }, { import = "astrocommunity.indent.mini-indentscope" },
{ import = "astrocommunity.markdown-and-latex.glow-nvim" }, { import = "astrocommunity.markdown-and-latex.glow-nvim" },
{ import = "astrocommunity.motion.harpoon" },
{ import = "astrocommunity.pack.php" }, { import = "astrocommunity.pack.php" },
{ import = "astrocommunity.pack.typescript" }, { import = "astrocommunity.pack.typescript" },
{ import = "astrocommunity.project.neoconf-nvim" }, { import = "astrocommunity.project.neoconf-nvim" },
{ import = "astrocommunity.project.nvim-spectre" },
{ import = "astrocommunity.project.project-nvim" },
{ import = "astrocommunity.test.neotest" }, { import = "astrocommunity.test.neotest" },
{ import = "astrocommunity.utility.neodim" }, { import = "astrocommunity.utility.neodim" },
{ import = "astrocommunity.utility.transparent-nvim" },
} }

View File

@@ -11,20 +11,21 @@ done
TLDR_GIT="https://github.com/tldr-pages/tldr.git" TLDR_GIT="https://github.com/tldr-pages/tldr.git"
TLDR_SOURCE="source: $TLDR_GIT" TLDR_SOURCE="source: $TLDR_GIT"
TLDR_SYNTAX="syntax: markdown" TLDR_SYNTAX="syntax: markdown"
TLDR_TAGS="tags: [bash]"
TLDR_TEMP_PREFIX=$(basename "$0") TLDR_TEMP_PREFIX=$(basename "$0")
TLDR_TEMP_DIR="/tmp/cheat-tldr-$(rnd)" TLDR_TEMP_DIR="/tmp/cheat-tldr-$(rnd)"
# If there's no .git, clone the folder # If there's no .git, clone the folder
if [ ! -d "$TLDR_TEMP_DIR/.git" ]; then if [ ! -d "$TLDR_TEMP_DIR/.git" ]; then
git clone "$TLDR_GIT" "$TLDR_TEMP_DIR" git clone --depth 1 "$TLDR_GIT" "$TLDR_TEMP_DIR"
fi fi
# Fetch the destination directory from cheat defined directories. # Fetch the destination directory from cheat defined directories.
TLDR_CHEAT_DEST="$(cheat -d | grep tldr | head -1 | awk '{print $2}')" TLDR_CHEAT_DEST="$(cheat -d | grep tldr | head -1 | awk '{print $2}')"
[ "$TLDR_CHEAT_DEST" = "" ] && msg_err "cheat doesn't know about the destination" && exit 1 [ "$TLDR_CHEAT_DEST" = "" ] \
&& msg_err "cheat doesn't know about the destination" \
&& exit 1
if [ ! -d "$TLDR_CHEAT_DEST" ]; then if [ ! -d "$TLDR_CHEAT_DEST" ]; then
mkdir -p "$TLDR_CHEAT_DEST" mkdir -p "$TLDR_CHEAT_DEST"
@@ -34,16 +35,8 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
DIRNAME=$(basename "$d") DIRNAME=$(basename "$d")
# echo "-> $DIRNAME ($d)" # echo "-> $DIRNAME ($d)"
case "$DIRNAME" in SECTION_DIR="${TLDR_CHEAT_DEST}/$DIRNAME"
*common) TLDR_TAGS="tags: [$DIRNAME]"
SECTION_DIR="${TLDR_CHEAT_DEST}"
TLDR_TAGS="tags: [common]"
;;
*)
SECTION_DIR="${TLDR_CHEAT_DEST}/$DIRNAME"
TLDR_TAGS="tags: [$DIRNAME]"
;;
esac
if [ ! -d "$SECTION_DIR" ]; then if [ ! -d "$SECTION_DIR" ]; then
mkdir -p "$SECTION_DIR" mkdir -p "$SECTION_DIR"