diff --git a/CMakeLists.txt b/CMakeLists.txt index b8a5ccd..1bb9a9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,8 @@ if (UNIX AND NOT MINGW) if (NOT DEFINED CPACK_GENERATOR) set(CPACK_GENERATOR TGZ;STGZ;RPM;DEB) endif() - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/bash-completion.sh DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/ybcon.d) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/bash-completion.sh ${CMAKE_CURRENT_SOURCE_DIR}/scripts/fish-completion.fish + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/ybcon.d) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ybcon ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ybcon.sh PERMISSIONS OWNER_WRITE diff --git a/README.md b/README.md index 96a7386..5bde094 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Aka Yer Bacon, - #### A language that transpiles into lua, javascript or python code. -Here's how the "hello world" will look like. +Here's how the basic "hello world" script will look like. ``` main #= [] -> { println "Hello, World!" diff --git a/scripts/fish-completion.fish b/scripts/fish-completion.fish new file mode 100644 index 0000000..7bb5a63 --- /dev/null +++ b/scripts/fish-completion.fish @@ -0,0 +1 @@ +set -l commands --help -p --printresult \ No newline at end of file diff --git a/scripts/postinst.sh b/scripts/postinst.sh index 32e7c15..b5aae20 100644 --- a/scripts/postinst.sh +++ b/scripts/postinst.sh @@ -4,7 +4,16 @@ ln -sf /opt/bin/ybcon.sh /usr/bin/ybcon +ybconDir="/opt/etc/ybcon.d" +fishLoc="/usr/share/fish/vendor_completions.d" bashcompleteLoc="/etc/bash_completion.d" if [ -d $bashcompleteLoc ]; then - ln -sf /opt/etc/ybcon.d/bash-completion.sh "$bashcompleteLoc/ybcon.sh" + ln -sf "$ybconDir/bash-completion.sh" "$bashcompleteLoc/ybcon.sh" +fi + +if [ -f "fish" ]; then + if [ ! -d $fishLoc ]; then + mkdir "$fishLoc" + fi + ln -sf "$ybconDir/fish-completion.fish" "$fishLoc/ybcon.fish" fi \ No newline at end of file