Skip to content

Commit

Permalink
Merge pull request #1160 from alexanderwoehler/fix-snippets
Browse files Browse the repository at this point in the history
fix(snippets): fixed existence-check snippets
  • Loading branch information
skovhus authored May 13, 2024
2 parents 81125b8 + 1fc9819 commit 2d51e28
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions server/src/snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,20 @@ export const SNIPPETS: BashCompletionItem[] = [
{
label: 'if-defined',
documentation: 'if with variable existence check',
insertText: ['if [[ -n "${${1:variable}+x}" ]]', '\t${2:command ...}', 'fi'].join(
'\n',
),
insertText: [
'if [[ -n "${${1:variable}+x}" ]]; then',
'\t${2:command ...}',
'fi',
].join('\n'),
},
{
label: 'if-not-defined',
documentation: 'if with variable existence check',
insertText: ['if [[ -z "${${1:variable}+x}" ]]', '\t${2:command ...}', 'fi'].join(
'\n',
),
insertText: [
'if [[ -z "${${1:variable}+x}" ]]; then',
'\t${2:command ...}',
'fi',
].join('\n'),
},
{
label: 'while',
Expand Down

0 comments on commit 2d51e28

Please sign in to comment.