summaryrefslogtreecommitdiff
path: root/public/nvim/.nvim/lua/snippets/sh/bash-misc.lua
blob: f3a11eb0e6ed41b4f6b72793e02792eab258157d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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",
		}),
	}),
}