From 85d7d7c082bd84d3c701ceec3d477ee37db5c827 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 18 Feb 2024 08:19:51 +0100 Subject: bootstrap --- lua/snippets/sh/bash-misc.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lua/snippets/sh/bash-misc.lua (limited to 'lua/snippets/sh/bash-misc.lua') diff --git a/lua/snippets/sh/bash-misc.lua b/lua/snippets/sh/bash-misc.lua new file mode 100644 index 0000000..f3a11eb --- /dev/null +++ b/lua/snippets/sh/bash-misc.lua @@ -0,0 +1,16 @@ +return { + s({ + trig = "no-source", + dscr = "Exit with an error if script is being sourced", + }, { + t({ + 'if [[ "${0}" != "${BASH_SOURCE[0]}" ]]; then', + '\techo "Error: script ${BASH_SOURCE[0]} is not supported to be sourced!"', + "\treturn 1", + "fi", + }), + }), +} + + + -- cgit v1.2.3