Skip to content

Commit fe79162

Browse files
committed
Format code
1 parent e9adf2a commit fe79162

File tree

9 files changed

+33
-43
lines changed

9 files changed

+33
-43
lines changed

src/App.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020
</main>
2121
<footer>
2222
If you like this project, please consider leaving a <StarIcon class="icon"></StarIcon> on
23-
<a
24-
href="https://github.com/Scriptim/bash-prompt-generator"
25-
target="_blank"
26-
rel="noopener noreferrer"
27-
>GitHub</a>.
23+
<a href="https://github.com/Scriptim/bash-prompt-generator" target="_blank" rel="noopener noreferrer">GitHub</a>.
2824
</footer>
2925
</template>
3026

src/components/SiteHeader.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ export default defineComponent({
5454
* Opens the usage instructions in the README.md file on GitHub.
5555
*/
5656
openHelp(): void {
57-
window.open(
58-
'https://github.com/Scriptim/bash-prompt-generator#how-to-use',
59-
'_blank',
60-
);
57+
window.open('https://github.com/Scriptim/bash-prompt-generator#how-to-use', '_blank');
6158
},
6259
/**
6360
* Toggles the dark mode.

src/components/base/EmptyState.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default defineComponent({
1919
props: {
2020
/**
2121
* Whether the current state is empty.
22-
*
22+
*
2323
* The component is displayed iff this is `true`.
2424
*/
2525
empty: {

src/components/elementselection/ElementSelection.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default defineComponent({
5454
*/
5555
separate(element: PromptElementType) {
5656
return PROMPT_ELEMENT_TYPES_SEPARATORS.includes(element.name);
57-
}
57+
},
5858
},
5959
});
6060
</script>

src/components/output/PS1Variable.vue

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,34 @@
1111
</div>
1212
<div class="hint" v-if="hasElement('Set Window Title')">
1313
Elements between the <code>Set Window Title</code> and the next <code>Bell</code> element are used to modify the
14-
window title of the terminal, if supported.
15-
Any styling properties of those elements are ignored.
14+
window title of the terminal, if supported. Any styling properties of those elements are ignored.
1615
</div>
1716
<div class="hint" v-if="hasElement('Advanced Git Prompt')">
1817
The <code>Advanced Git Prompt</code> element requires some extra work: Copy the
1918
<a
2019
href="https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh"
2120
target="_blank"
2221
rel="noopener noreferrer"
23-
><code>git-prompt.sh</code></a>
24-
file to your home directory and <code>source</code> it in your <code>~/.bashrc</code> file
25-
(as described in <code>git-prompt.sh</code>).
26-
By default the status will only contain the current branch name, however you can include more information using
27-
global or repository-local configuration options (which are also described in <code>git-prompt.sh</code>).
22+
><code>git-prompt.sh</code>
23+
</a>
24+
file to your home directory and <code>source</code> it in your <code>~/.bashrc</code> file (as described in
25+
<code>git-prompt.sh</code>). By default the status will only contain the current branch name, however you can
26+
include more information using global or repository-local configuration options (which are also described in
27+
<code>git-prompt.sh</code>).
2828
</div>
2929
<div class="hint" v-if="hasElement('Working Directory') || hasElement('Working Directory (Basename)')">
3030
You can limit the number of components in the working directory path by setting the
3131
<a
3232
href="https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-PROMPT_005fDIRTRIM"
3333
target="_blank"
3434
rel="noopener noreferrer"
35-
><code>PROMPT_DIRTRIM</code></a>
35+
><code>PROMPT_DIRTRIM</code>
36+
</a>
3637
environment variable in your <code>~/.bashrc</code> file.
3738
</div>
3839
<div class="hint" v-if="hasElement('Nerd Font Glyph')">
3940
For <code>Nerd Font Glyph</code> elements to be properly displayed, you need to have a
40-
<a
41-
href="https://www.nerdfonts.com/"
42-
target="_blank"
43-
rel="noopener noreferrer"
44-
>Nerd Font</a>
41+
<a href="https://www.nerdfonts.com/" target="_blank" rel="noopener noreferrer">Nerd Font</a>
4542
installed and configured in your terminal.
4643
</div>
4744
</template>

src/components/output/PromptPreview.vue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
<span v-for="element in elements.windowTitle" :key="element.id">
99
{{ element.data.type.preview(element.data.parameters) }}
1010
</span>
11-
<span>&nbsp;</span> <!-- Ensure there is at least one character even if the title is empty -->
11+
<!-- Ensure there is at least one character even if the title is empty -->
12+
<span>&nbsp;</span>
1213
<span class="preview-window-controls">
1314
<MinusCircleIcon class="icon"></MinusCircleIcon>
1415
<XCircleIcon class="icon"></XCircleIcon>
@@ -19,17 +20,21 @@
1920
v-for="element in elements.prompt"
2021
:key="element.id"
2122
:style="{
22-
backgroundColor: `${element.data.attributes.reverse
23-
? element.data.foregroundColor?.hex ?? (light ? '#212121' : '#fafafa')
24-
: element.data.backgroundColor?.hex ?? (light ? '#fafafa' : '#212121')} !important`,
23+
backgroundColor: `${
24+
element.data.attributes.reverse
25+
? element.data.foregroundColor?.hex ?? (light ? '#212121' : '#fafafa')
26+
: element.data.backgroundColor?.hex ?? (light ? '#fafafa' : '#212121')
27+
} !important`,
2528
}"
2629
>
2730
<span
2831
v-if="element.data.type.preview(element.data.parameters) !== '\n'"
2932
:style="{
30-
color: `${element.data.attributes.reverse
31-
? element.data.backgroundColor?.hex ?? (light ? '#fafafa' : '#212121')
32-
: element.data.foregroundColor?.hex ?? (light ? '#212121' : '#fafafa')} !important`,
33+
color: `${
34+
element.data.attributes.reverse
35+
? element.data.backgroundColor?.hex ?? (light ? '#fafafa' : '#212121')
36+
: element.data.foregroundColor?.hex ?? (light ? '#212121' : '#fafafa')
37+
} !important`,
3338
}"
3439
:class="{
3540
'preview-bold': element.data.attributes.bold,
@@ -169,7 +174,7 @@ export default defineComponent({
169174
return {
170175
prompt: crPartitions.prompt.reduce(mergeCrPartitions),
171176
windowTitle: crPartitions.windowTitle.reduce(mergeCrPartitions),
172-
windowTitleSet
177+
windowTitleSet,
173178
};
174179
},
175180
},

src/components/prompteditor/PromptElements.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<p>Alternatively, you can paste your existing <code>PS1</code> string to import it:</p>
2525
<label for="import-ps1" class="import-prompt">
2626
<code>$PS1</code>
27-
<br>
27+
<br />
2828
<input
2929
type="text"
3030
id="import-ps1"
@@ -34,10 +34,10 @@
3434
spellcheck="false"
3535
/>
3636
</label>
37-
<br>
37+
<br />
3838
<label for="import-prompt_command" class="import-prompt">
3939
<code>$PROMPT_COMMAND</code>&nbsp;<small>(optional)</small>
40-
<br>
40+
<br />
4141
<input
4242
type="text"
4343
id="import-prompt_command"
@@ -47,7 +47,7 @@
4747
spellcheck="false"
4848
/>
4949
</label>
50-
<br>
50+
<br />
5151
<IconButton icon="ArrowDownOnSquareIcon" title="Import prompt" @click="importPS1" />
5252
<p v-if="promptInputError" class="import-error">{{ promptInputError }}</p>
5353
</EmptyState>

src/lib/enum/nerdfontglyph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43111,7 +43111,7 @@ const fuse = new Fuse(NERD_FONT_GLYPHS, {
4311143111

4311243112
/**
4311343113
* Find Nerd Font glyphs by a fuzzy search on their names.
43114-
*
43114+
*
4311543115
* @param name The case-insensitive name to search for.
4311643116
* @returns A limited list of glyphs that match the search term, sorted by score.
4311743117
*/

src/lib/promptParser.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,7 @@ function applyPromptCommand(ps1: PromptElement[], promptCommand: string): Prompt
296296
varAssignments.forEach((assignment) => {
297297
const match = assignment.match(assignmentRegex);
298298
if (match === null) {
299-
throw new PromptParserError(
300-
'Could not parse command assignments in prompt command',
301-
promptCommand,
302-
0,
303-
10
304-
);
299+
throw new PromptParserError('Could not parse command assignments in prompt command', promptCommand, 0, 10);
305300
}
306301

307302
const variableName = match[1];

0 commit comments

Comments
 (0)