Skip to content

Commit

Permalink
fix(snippets): add missing "then" to existence checks
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderwoehler committed May 12, 2024
1 parent 81125b8 commit 1fc9819
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 1fc9819

Please sign in to comment.