Skip to content

Commit

Permalink
update script spitout added
Browse files Browse the repository at this point in the history
  • Loading branch information
wolandark committed Jun 27, 2024
1 parent 8c763d8 commit 44ef4d5
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions symlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,55 @@ linkFiles()
echo "[[Wim]]" > "$_WIKI_DIR/$_VIMWIKI_INDEX"
}

createUpdateScript()
{
cat << 'EOF' > update.sh
#!/bin/sh
# Check parent wim dir exists
checkWimExist()
{
if [ "$parent_dir" = "wim" ]; then
printf "Wim Directory Exists!\nProceeding ...\n"
else
printf "Wim Directory Does Not Exists!\nBreaking! ...\n"
exit 1
fi
if [ -d "$_CONFIG_DIR" ]; then
printf "Config Directory Exists!\nProceeding ...\n"
else
printf "Config Directory Does Not Exists!\nBreaking! ...\n"
exit 1
fi
}
# link the files
linkFiles()
{
printf "\e[42;30mSymlinking Latest Vimrc\e[0m\n"
ln -sf "$(pwd)/$_VIMRC_FILE" "$_VIMRC_FILE_DEST"
printf "\e[42;30mSymlinking Latest CoC Settings\e[0m\n"
ln -sf "$(pwd)/$_COC_FILE" "$_COC_FILE_DEST"
printf "\e[42;30mSymlinking Latest Wim Wiki\e[0m\n"
ln -sf "$(pwd)/$_WIKI_FILE" "$_WIKI_FILE_DEST"
printf "\e[42;30mSymlinking Latest Cheat File\e[0m\n"
ln -sf "$(pwd)/$_CHEAT_FILE" "$_CHEAT_FILE_DEST"
echo ""
echo "[[Wim]]" > "$_WIKI_DIR/$_VIMWIKI_INDEX"
}
EOF

chmod +x update.sh
echo "Update Script Generated!"
}
main()
{
backup
downloadCtags
checkWimExist
linkFiles
createUpdateScript
}

main
Expand Down

0 comments on commit 44ef4d5

Please sign in to comment.