@shell-shock/plugin-completions 0.4.14 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/bash-config-command.cjs +6 -120
- package/dist/components/bash-config-command.mjs +6 -119
- package/dist/components/bash-config-command.mjs.map +1 -1
- package/dist/components/bash-script-command.cjs +5 -105
- package/dist/components/bash-script-command.mjs +5 -104
- package/dist/components/bash-script-command.mjs.map +1 -1
- package/dist/components/bash-shared.cjs +13 -77
- package/dist/components/bash-shared.mjs +13 -76
- package/dist/components/bash-shared.mjs.map +1 -1
- package/dist/components/fish-config-command.cjs +6 -120
- package/dist/components/fish-config-command.mjs +6 -119
- package/dist/components/fish-config-command.mjs.map +1 -1
- package/dist/components/fish-script-command.cjs +4 -104
- package/dist/components/fish-script-command.mjs +4 -103
- package/dist/components/fish-script-command.mjs.map +1 -1
- package/dist/components/fish-shared.cjs +77 -141
- package/dist/components/fish-shared.mjs +77 -140
- package/dist/components/fish-shared.mjs.map +1 -1
- package/dist/components/index.cjs +1 -26
- package/dist/components/index.mjs +1 -14
- package/dist/components/powershell-config-command.cjs +6 -116
- package/dist/components/powershell-config-command.mjs +6 -115
- package/dist/components/powershell-config-command.mjs.map +1 -1
- package/dist/components/powershell-script-command.cjs +4 -104
- package/dist/components/powershell-script-command.mjs +4 -103
- package/dist/components/powershell-script-command.mjs.map +1 -1
- package/dist/components/powershell-shared.cjs +37 -101
- package/dist/components/powershell-shared.mjs +37 -100
- package/dist/components/powershell-shared.mjs.map +1 -1
- package/dist/components/zsh-config-command.cjs +6 -120
- package/dist/components/zsh-config-command.mjs +6 -119
- package/dist/components/zsh-config-command.mjs.map +1 -1
- package/dist/components/zsh-script-command.cjs +6 -108
- package/dist/components/zsh-script-command.mjs +6 -107
- package/dist/components/zsh-script-command.mjs.map +1 -1
- package/dist/components/zsh-shared.cjs +42 -106
- package/dist/components/zsh-shared.mjs +42 -105
- package/dist/components/zsh-shared.mjs.map +1 -1
- package/dist/helpers/complete-command.cjs +1 -10
- package/dist/helpers/complete-command.mjs +1 -8
- package/dist/helpers/complete-command.mjs.map +1 -1
- package/dist/helpers/completion-directive-constants.cjs +1 -16
- package/dist/helpers/completion-directive-constants.mjs +1 -14
- package/dist/helpers/completion-directive-constants.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -6
- package/dist/helpers/index.mjs +1 -4
- package/dist/index.cjs +1 -303
- package/dist/index.mjs +1 -301
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.cjs +1 -4
- package/dist/types/index.mjs +1 -3
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/shell-type.cjs +1 -12
- package/dist/types/shell-type.mjs +1 -10
- package/dist/types/shell-type.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -1,100 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
-
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
4
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
-
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
7
|
-
let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
|
|
8
|
-
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
9
|
-
let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
|
|
10
|
-
let _stryke_path = require("@stryke/path");
|
|
11
|
-
|
|
12
|
-
//#region src/components/powershell-config-command.tsx
|
|
13
|
-
function PowerShellConfigCompletionsCommand() {
|
|
14
|
-
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
15
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
|
|
16
|
-
get path() {
|
|
17
|
-
return (0, _stryke_path.joinPaths)(context.entryPath, "completions", "powershell", "config", "command.ts");
|
|
18
|
-
},
|
|
19
|
-
imports: {
|
|
20
|
-
"node:os": "os",
|
|
21
|
-
"node:path": ["join"],
|
|
22
|
-
"node:fs/promises": ["readFile", "writeFile"],
|
|
23
|
-
"../shared": ["SHELL_COMPLETIONS", "SHELL_COMPLETIONS_DISPLAY"]
|
|
24
|
-
},
|
|
25
|
-
builtinImports: { "shell-shock:console": [
|
|
26
|
-
"bold",
|
|
27
|
-
"inlineCode",
|
|
28
|
-
"writeLine",
|
|
29
|
-
"success",
|
|
30
|
-
"warn",
|
|
31
|
-
"help"
|
|
32
|
-
] },
|
|
33
|
-
get children() {
|
|
34
|
-
return [
|
|
35
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TSDoc, { heading: "Options for the PowerShell Completions - Configuration command." }),
|
|
36
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
37
|
-
"export": true,
|
|
38
|
-
name: "PowerShellConfigCompletionsOptions",
|
|
39
|
-
get children() {
|
|
40
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TSDoc, {
|
|
41
|
-
heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
|
|
42
|
-
get children() {
|
|
43
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TSDocDefaultValue, {
|
|
44
|
-
get type() {
|
|
45
|
-
return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
|
|
46
|
-
},
|
|
47
|
-
defaultValue: false
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
51
|
-
name: "display",
|
|
52
|
-
optional: true,
|
|
53
|
-
type: "boolean"
|
|
54
|
-
})];
|
|
55
|
-
}
|
|
56
|
-
}),
|
|
57
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
58
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TSDoc, { heading: "Handler logic for the \\`completions powershell config\\` command." }),
|
|
59
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
60
|
-
"export": true,
|
|
61
|
-
"default": true,
|
|
62
|
-
async: true,
|
|
63
|
-
name: "handler",
|
|
64
|
-
parameters: [{
|
|
65
|
-
name: "options",
|
|
66
|
-
type: "PowerShellConfigCompletionsOptions",
|
|
67
|
-
default: "{}"
|
|
68
|
-
}, {
|
|
69
|
-
name: "path",
|
|
70
|
-
type: "string",
|
|
71
|
-
default: `"~/.config/powershell/Microsoft.PowerShell_profile.ps1"`
|
|
72
|
-
}],
|
|
73
|
-
get children() {
|
|
74
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
75
|
-
condition: _alloy_js_core.code`options.display !== true`,
|
|
76
|
-
get children() {
|
|
77
|
-
return [
|
|
78
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
79
|
-
"let": true,
|
|
80
|
-
name: "configPath",
|
|
81
|
-
type: "string",
|
|
82
|
-
initializer: _alloy_js_core.code` path.includes(".") ? path : join(path, "Microsoft.PowerShell_profile.ps1");`
|
|
83
|
-
}),
|
|
84
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
85
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
86
|
-
condition: _alloy_js_core.code`configPath.startsWith("~")`,
|
|
87
|
-
children: _alloy_js_core.code`configPath = join(os.homedir(), configPath.replace("~", "")); `
|
|
88
|
-
}),
|
|
89
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
90
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
91
|
-
"let": true,
|
|
92
|
-
name: "content",
|
|
93
|
-
type: "string",
|
|
94
|
-
initializer: _alloy_js_core.code`"";`
|
|
95
|
-
}),
|
|
96
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
97
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`try {
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@shell-shock/core/plugin-utils`),n=require(`@alloy-js/core`),r=require(`@alloy-js/typescript`),i=require(`@powerlines/deepkit/vendor/type`),a=require(`@powerlines/plugin-alloy/core`),o=require(`@powerlines/plugin-alloy/core/contexts/context`),s=require(`@powerlines/plugin-alloy/typescript`),c=require(`@stryke/path`);function l(){let l=(0,o.usePowerlines)();return(0,e.createComponent)(s.TypescriptFile,{get path(){return(0,c.joinPaths)(l.entryPath,`completions`,`powershell`,`config`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS`,`SHELL_COMPLETIONS_DISPLAY`]},builtinImports:{"shell-shock:console":[`bold`,`inlineCode`,`writeLine`,`success`,`warn`,`help`]},get children(){return[(0,e.createComponent)(s.TSDoc,{heading:`Options for the PowerShell Completions - Configuration command.`}),(0,e.createComponent)(r.InterfaceDeclaration,{export:!0,name:`PowerShellConfigCompletionsOptions`,get children(){return[(0,e.createComponent)(s.TSDoc,{heading:`Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.`,get children(){return(0,e.createComponent)(s.TSDocDefaultValue,{get type(){return i.ReflectionKind.boolean},defaultValue:!1})}}),(0,e.createComponent)(r.InterfaceMember,{name:`display`,optional:!0,type:`boolean`})]}}),(0,e.createComponent)(a.Spacing,{}),(0,e.createComponent)(s.TSDoc,{heading:"Handler logic for the \\`completions powershell config\\` command."}),(0,e.createComponent)(r.FunctionDeclaration,{export:!0,default:!0,async:!0,name:`handler`,parameters:[{name:`options`,type:`PowerShellConfigCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"~/.config/powershell/Microsoft.PowerShell_profile.ps1"`}],get children(){return[(0,e.createComponent)(r.IfStatement,{condition:n.code`options.display !== true`,get children(){return[(0,e.createComponent)(r.VarDeclaration,{let:!0,name:`configPath`,type:`string`,initializer:n.code` path.includes(".") ? path : join(path, "Microsoft.PowerShell_profile.ps1");`}),(0,e.createComponent)(a.Spacing,{}),(0,e.createComponent)(r.IfStatement,{condition:n.code`configPath.startsWith("~")`,children:n.code`configPath = join(os.homedir(), configPath.replace("~", "")); `}),(0,e.createComponent)(a.Spacing,{}),(0,e.createComponent)(r.VarDeclaration,{let:!0,name:`content`,type:`string`,initializer:n.code`"";`}),(0,e.createComponent)(a.Spacing,{}),(0,e.memo)(()=>n.code`try {
|
|
98
2
|
content = await readFile(configPath, "utf8");
|
|
99
3
|
} catch (error) {
|
|
100
4
|
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
|
|
@@ -105,19 +9,15 @@ function PowerShellConfigCompletionsCommand() {
|
|
|
105
9
|
}
|
|
106
10
|
}
|
|
107
11
|
|
|
108
|
-
await writeFile(configPath, \`\${content}\\n\\n### Begin - ${(0,
|
|
12
|
+
await writeFile(configPath, \`\${content}\\n\\n### Begin - ${(0,t.getAppTitle)(l)} PowerShell Completions ###\\n\\n\${SHELL_COMPLETIONS} \\n\\n### End - ${(0,t.getAppTitle)(l)} PowerShell Completions ###\`);
|
|
109
13
|
|
|
110
|
-
success(\`${(0,
|
|
111
|
-
];
|
|
112
|
-
}
|
|
113
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { get children() {
|
|
114
|
-
return _alloy_js_core.code`writeLine(" ------------------------------------------------- ");
|
|
14
|
+
success(\`${(0,t.getAppTitle)(l)} shell completions have been applied to PowerShell configuration file at \${bold(configPath)}. Please restart your terminal or run \${inlineCode(\`source \${configPath}\`)} for the changes to take effect.\`); `)]}}),(0,e.createComponent)(r.ElseClause,{get children(){return n.code`writeLine(" ------------------------------------------------- ");
|
|
115
15
|
writeLine("");
|
|
116
|
-
writeLine(\`### Begin - ${(0,
|
|
16
|
+
writeLine(\`### Begin - ${(0,t.getAppTitle)(l)} PowerShell Completions ###\`);
|
|
117
17
|
writeLine("");
|
|
118
18
|
SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
|
|
119
19
|
writeLine("");
|
|
120
|
-
writeLine(\`### End - ${(0,
|
|
20
|
+
writeLine(\`### End - ${(0,t.getAppTitle)(l)} PowerShell Completions ###\`);
|
|
121
21
|
writeLine("");
|
|
122
22
|
writeLine(" ------------------------------------------------- ");
|
|
123
23
|
|
|
@@ -125,14 +25,4 @@ function PowerShellConfigCompletionsCommand() {
|
|
|
125
25
|
help(\`To enable these completions, perform one of the following actions:
|
|
126
26
|
|
|
127
27
|
1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)
|
|
128
|
-
2) Save the above script to a file and source it from your shell configuration file \`);
|
|
129
|
-
} })];
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
//#endregion
|
|
138
|
-
exports.PowerShellConfigCompletionsCommand = PowerShellConfigCompletionsCommand;
|
|
28
|
+
2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}exports.PowerShellConfigCompletionsCommand=l;
|
|
@@ -1,99 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
3
|
-
import { code } from "@alloy-js/core";
|
|
4
|
-
import { ElseClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, InterfaceMember, VarDeclaration } from "@alloy-js/typescript";
|
|
5
|
-
import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
6
|
-
import { Spacing } from "@powerlines/plugin-alloy/core";
|
|
7
|
-
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
8
|
-
import { TSDoc, TSDocDefaultValue, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
|
|
9
|
-
import { joinPaths } from "@stryke/path";
|
|
10
|
-
|
|
11
|
-
//#region src/components/powershell-config-command.tsx
|
|
12
|
-
function PowerShellConfigCompletionsCommand() {
|
|
13
|
-
const context = usePowerlines();
|
|
14
|
-
return createComponent(TypescriptFile, {
|
|
15
|
-
get path() {
|
|
16
|
-
return joinPaths(context.entryPath, "completions", "powershell", "config", "command.ts");
|
|
17
|
-
},
|
|
18
|
-
imports: {
|
|
19
|
-
"node:os": "os",
|
|
20
|
-
"node:path": ["join"],
|
|
21
|
-
"node:fs/promises": ["readFile", "writeFile"],
|
|
22
|
-
"../shared": ["SHELL_COMPLETIONS", "SHELL_COMPLETIONS_DISPLAY"]
|
|
23
|
-
},
|
|
24
|
-
builtinImports: { "shell-shock:console": [
|
|
25
|
-
"bold",
|
|
26
|
-
"inlineCode",
|
|
27
|
-
"writeLine",
|
|
28
|
-
"success",
|
|
29
|
-
"warn",
|
|
30
|
-
"help"
|
|
31
|
-
] },
|
|
32
|
-
get children() {
|
|
33
|
-
return [
|
|
34
|
-
createComponent(TSDoc, { heading: "Options for the PowerShell Completions - Configuration command." }),
|
|
35
|
-
createComponent(InterfaceDeclaration, {
|
|
36
|
-
"export": true,
|
|
37
|
-
name: "PowerShellConfigCompletionsOptions",
|
|
38
|
-
get children() {
|
|
39
|
-
return [createComponent(TSDoc, {
|
|
40
|
-
heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
|
|
41
|
-
get children() {
|
|
42
|
-
return createComponent(TSDocDefaultValue, {
|
|
43
|
-
get type() {
|
|
44
|
-
return ReflectionKind.boolean;
|
|
45
|
-
},
|
|
46
|
-
defaultValue: false
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}), createComponent(InterfaceMember, {
|
|
50
|
-
name: "display",
|
|
51
|
-
optional: true,
|
|
52
|
-
type: "boolean"
|
|
53
|
-
})];
|
|
54
|
-
}
|
|
55
|
-
}),
|
|
56
|
-
createComponent(Spacing, {}),
|
|
57
|
-
createComponent(TSDoc, { heading: "Handler logic for the \\`completions powershell config\\` command." }),
|
|
58
|
-
createComponent(FunctionDeclaration, {
|
|
59
|
-
"export": true,
|
|
60
|
-
"default": true,
|
|
61
|
-
async: true,
|
|
62
|
-
name: "handler",
|
|
63
|
-
parameters: [{
|
|
64
|
-
name: "options",
|
|
65
|
-
type: "PowerShellConfigCompletionsOptions",
|
|
66
|
-
default: "{}"
|
|
67
|
-
}, {
|
|
68
|
-
name: "path",
|
|
69
|
-
type: "string",
|
|
70
|
-
default: `"~/.config/powershell/Microsoft.PowerShell_profile.ps1"`
|
|
71
|
-
}],
|
|
72
|
-
get children() {
|
|
73
|
-
return [createComponent(IfStatement, {
|
|
74
|
-
condition: code`options.display !== true`,
|
|
75
|
-
get children() {
|
|
76
|
-
return [
|
|
77
|
-
createComponent(VarDeclaration, {
|
|
78
|
-
"let": true,
|
|
79
|
-
name: "configPath",
|
|
80
|
-
type: "string",
|
|
81
|
-
initializer: code` path.includes(".") ? path : join(path, "Microsoft.PowerShell_profile.ps1");`
|
|
82
|
-
}),
|
|
83
|
-
createComponent(Spacing, {}),
|
|
84
|
-
createComponent(IfStatement, {
|
|
85
|
-
condition: code`configPath.startsWith("~")`,
|
|
86
|
-
children: code`configPath = join(os.homedir(), configPath.replace("~", "")); `
|
|
87
|
-
}),
|
|
88
|
-
createComponent(Spacing, {}),
|
|
89
|
-
createComponent(VarDeclaration, {
|
|
90
|
-
"let": true,
|
|
91
|
-
name: "content",
|
|
92
|
-
type: "string",
|
|
93
|
-
initializer: code`"";`
|
|
94
|
-
}),
|
|
95
|
-
createComponent(Spacing, {}),
|
|
96
|
-
memo(() => code`try {
|
|
1
|
+
import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{getAppTitle as n}from"@shell-shock/core/plugin-utils";import{code as r}from"@alloy-js/core";import{ElseClause as i,FunctionDeclaration as a,IfStatement as o,InterfaceDeclaration as s,InterfaceMember as c,VarDeclaration as l}from"@alloy-js/typescript";import{ReflectionKind as u}from"@powerlines/deepkit/vendor/type";import{Spacing as d}from"@powerlines/plugin-alloy/core";import{usePowerlines as f}from"@powerlines/plugin-alloy/core/contexts/context";import{TSDoc as p,TSDocDefaultValue as m,TypescriptFile as h}from"@powerlines/plugin-alloy/typescript";import{joinPaths as g}from"@stryke/path";function _(){let _=f();return e(h,{get path(){return g(_.entryPath,`completions`,`powershell`,`config`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS`,`SHELL_COMPLETIONS_DISPLAY`]},builtinImports:{"shell-shock:console":[`bold`,`inlineCode`,`writeLine`,`success`,`warn`,`help`]},get children(){return[e(p,{heading:`Options for the PowerShell Completions - Configuration command.`}),e(s,{export:!0,name:`PowerShellConfigCompletionsOptions`,get children(){return[e(p,{heading:`Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.`,get children(){return e(m,{get type(){return u.boolean},defaultValue:!1})}}),e(c,{name:`display`,optional:!0,type:`boolean`})]}}),e(d,{}),e(p,{heading:"Handler logic for the \\`completions powershell config\\` command."}),e(a,{export:!0,default:!0,async:!0,name:`handler`,parameters:[{name:`options`,type:`PowerShellConfigCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"~/.config/powershell/Microsoft.PowerShell_profile.ps1"`}],get children(){return[e(o,{condition:r`options.display !== true`,get children(){return[e(l,{let:!0,name:`configPath`,type:`string`,initializer:r` path.includes(".") ? path : join(path, "Microsoft.PowerShell_profile.ps1");`}),e(d,{}),e(o,{condition:r`configPath.startsWith("~")`,children:r`configPath = join(os.homedir(), configPath.replace("~", "")); `}),e(d,{}),e(l,{let:!0,name:`content`,type:`string`,initializer:r`"";`}),e(d,{}),t(()=>r`try {
|
|
97
2
|
content = await readFile(configPath, "utf8");
|
|
98
3
|
} catch (error) {
|
|
99
4
|
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
|
|
@@ -104,19 +9,15 @@ function PowerShellConfigCompletionsCommand() {
|
|
|
104
9
|
}
|
|
105
10
|
}
|
|
106
11
|
|
|
107
|
-
await writeFile(configPath, \`\${content}\\n\\n### Begin - ${
|
|
12
|
+
await writeFile(configPath, \`\${content}\\n\\n### Begin - ${n(_)} PowerShell Completions ###\\n\\n\${SHELL_COMPLETIONS} \\n\\n### End - ${n(_)} PowerShell Completions ###\`);
|
|
108
13
|
|
|
109
|
-
success(\`${
|
|
110
|
-
];
|
|
111
|
-
}
|
|
112
|
-
}), createComponent(ElseClause, { get children() {
|
|
113
|
-
return code`writeLine(" ------------------------------------------------- ");
|
|
14
|
+
success(\`${n(_)} shell completions have been applied to PowerShell configuration file at \${bold(configPath)}. Please restart your terminal or run \${inlineCode(\`source \${configPath}\`)} for the changes to take effect.\`); `)]}}),e(i,{get children(){return r`writeLine(" ------------------------------------------------- ");
|
|
114
15
|
writeLine("");
|
|
115
|
-
writeLine(\`### Begin - ${
|
|
16
|
+
writeLine(\`### Begin - ${n(_)} PowerShell Completions ###\`);
|
|
116
17
|
writeLine("");
|
|
117
18
|
SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
|
|
118
19
|
writeLine("");
|
|
119
|
-
writeLine(\`### End - ${
|
|
20
|
+
writeLine(\`### End - ${n(_)} PowerShell Completions ###\`);
|
|
120
21
|
writeLine("");
|
|
121
22
|
writeLine(" ------------------------------------------------- ");
|
|
122
23
|
|
|
@@ -124,15 +25,5 @@ function PowerShellConfigCompletionsCommand() {
|
|
|
124
25
|
help(\`To enable these completions, perform one of the following actions:
|
|
125
26
|
|
|
126
27
|
1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)
|
|
127
|
-
2) Save the above script to a file and source it from your shell configuration file \`);
|
|
128
|
-
} })];
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
];
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
//#endregion
|
|
137
|
-
export { PowerShellConfigCompletionsCommand };
|
|
28
|
+
2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}export{_ as PowerShellConfigCompletionsCommand};
|
|
138
29
|
//# sourceMappingURL=powershell-config-command.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powershell-config-command.mjs","names":[],"sources":["../../src/components/powershell-config-command.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { CompletionsPluginContext } from \"../types\";\n\nexport function PowerShellConfigCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"powershell\",\n \"config\",\n \"command.ts\"\n )}\n imports={{\n \"node:os\": \"os\",\n \"node:path\": [\"join\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"],\n \"../shared\": [\"SHELL_COMPLETIONS\", \"SHELL_COMPLETIONS_DISPLAY\"]\n }}\n builtinImports={{\n \"shell-shock:console\": [\n \"bold\",\n \"inlineCode\",\n \"writeLine\",\n \"success\",\n \"warn\",\n \"help\"\n ]\n }}>\n <TSDoc heading=\"Options for the PowerShell Completions - Configuration command.\" />\n <InterfaceDeclaration export name=\"PowerShellConfigCompletionsOptions\">\n <TSDoc heading=\"Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.\">\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"display\" optional type=\"boolean\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions powershell config\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"PowerShellConfigCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"~/.config/powershell/Microsoft.PowerShell_profile.ps1\"`\n }\n ]}>\n <IfStatement condition={code`options.display !== true`}>\n <VarDeclaration\n let\n name=\"configPath\"\n type=\"string\"\n initializer={code` path.includes(\".\") ? path : join(path, \"Microsoft.PowerShell_profile.ps1\");`}\n />\n <Spacing />\n <IfStatement condition={code`configPath.startsWith(\"~\")`}>\n {code`configPath = join(os.homedir(), configPath.replace(\"~\", \"\")); `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n let\n name=\"content\"\n type=\"string\"\n initializer={code`\"\";`}\n />\n <Spacing />\n {code`try {\n content = await readFile(configPath, \"utf8\");\n } catch (error) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\") {\n // If the file doesn't exist, we can create it later when writing the completion script.\n warn(\\`Configuration file \\${bold(configPath)} does not exist. It will be created when the completion script is written.\\`);\n } else {\n return { error };\n }\n }\n\n await writeFile(configPath, \\`\\${content}\\\\n\\\\n### Begin - ${getAppTitle(context)} PowerShell Completions ###\\\\n\\\\n\\${SHELL_COMPLETIONS} \\\\n\\\\n### End - ${getAppTitle(\n context\n )} PowerShell Completions ###\\`);\n\n success(\\`${getAppTitle(\n context\n )} shell completions have been applied to PowerShell configuration file at \\${bold(configPath)}. Please restart your terminal or run \\${inlineCode(\\`source \\${configPath}\\`)} for the changes to take effect.\\`); `}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`### Begin - ${getAppTitle(context)} PowerShell Completions ###\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\\`### End - ${getAppTitle(context)} PowerShell Completions ###\\`);\n writeLine(\"\");\n writeLine(\" ------------------------------------------------- \");\n\n writeLine(\"\");\n help(\\`To enable these completions, perform one of the following actions:\n\n 1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)\n 2) Save the above script to a file and source it from your shell configuration file \\`); `}\n </ElseClause>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"powershell-config-command.mjs","names":[],"sources":["../../src/components/powershell-config-command.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { CompletionsPluginContext } from \"../types\";\n\nexport function PowerShellConfigCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"powershell\",\n \"config\",\n \"command.ts\"\n )}\n imports={{\n \"node:os\": \"os\",\n \"node:path\": [\"join\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"],\n \"../shared\": [\"SHELL_COMPLETIONS\", \"SHELL_COMPLETIONS_DISPLAY\"]\n }}\n builtinImports={{\n \"shell-shock:console\": [\n \"bold\",\n \"inlineCode\",\n \"writeLine\",\n \"success\",\n \"warn\",\n \"help\"\n ]\n }}>\n <TSDoc heading=\"Options for the PowerShell Completions - Configuration command.\" />\n <InterfaceDeclaration export name=\"PowerShellConfigCompletionsOptions\">\n <TSDoc heading=\"Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.\">\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"display\" optional type=\"boolean\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions powershell config\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"PowerShellConfigCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"~/.config/powershell/Microsoft.PowerShell_profile.ps1\"`\n }\n ]}>\n <IfStatement condition={code`options.display !== true`}>\n <VarDeclaration\n let\n name=\"configPath\"\n type=\"string\"\n initializer={code` path.includes(\".\") ? path : join(path, \"Microsoft.PowerShell_profile.ps1\");`}\n />\n <Spacing />\n <IfStatement condition={code`configPath.startsWith(\"~\")`}>\n {code`configPath = join(os.homedir(), configPath.replace(\"~\", \"\")); `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n let\n name=\"content\"\n type=\"string\"\n initializer={code`\"\";`}\n />\n <Spacing />\n {code`try {\n content = await readFile(configPath, \"utf8\");\n } catch (error) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\") {\n // If the file doesn't exist, we can create it later when writing the completion script.\n warn(\\`Configuration file \\${bold(configPath)} does not exist. It will be created when the completion script is written.\\`);\n } else {\n return { error };\n }\n }\n\n await writeFile(configPath, \\`\\${content}\\\\n\\\\n### Begin - ${getAppTitle(context)} PowerShell Completions ###\\\\n\\\\n\\${SHELL_COMPLETIONS} \\\\n\\\\n### End - ${getAppTitle(\n context\n )} PowerShell Completions ###\\`);\n\n success(\\`${getAppTitle(\n context\n )} shell completions have been applied to PowerShell configuration file at \\${bold(configPath)}. Please restart your terminal or run \\${inlineCode(\\`source \\${configPath}\\`)} for the changes to take effect.\\`); `}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`### Begin - ${getAppTitle(context)} PowerShell Completions ###\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\\`### End - ${getAppTitle(context)} PowerShell Completions ###\\`);\n writeLine(\"\");\n writeLine(\" ------------------------------------------------- \");\n\n writeLine(\"\");\n help(\\`To enable these completions, perform one of the following actions:\n\n 1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)\n 2) Save the above script to a file and source it from your shell configuration file \\`); `}\n </ElseClause>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":"iqBA2BA,SAAS,GAA2C,CACpD,IAAQ,EAAU,GAAQ,CAC1B,OAAS,EAAgB,EAAkB,CAC3C,IAAO,MAAA,CACL,OAAK,EAAA,EAAA,UAAA,cAAA,aAAA,SAAA,aAAA,EAEL,QAAA,CACI,UAAG,KACH,YAAG,CAAW,OAAO,CACrB,mBAAoB,CAAC,WAAY,YAAC,CAClC,YAAQ,CAAA,oBAA2B,4BAAe,EAExD,eAAgB,CACd,sBAAgB,CAAA,OAAc,aAAA,YAA2B,UAAA,OAAA,OAAA,CAAA,CAEzD,IAAM,UAAC,CACJ,MAAA,CAAA,EAAA,EAAA,CACC,QAAM,kEACL,CAAC,CAAA,EAAiB,EAAA,CACjB,OAAC,GACD,KAAC,qCACD,IAAC,UAAO,CACP,MAAQ,CAAA,EAAE,EAAA,CACZ,QAAA,6LACD,IAAS,UAAA,CACD,OAAM,EAAG,EAAA,CACT,IAAM,MAAO,CACV,OAAQ,EAAe,SAEjC,aAAA,GACD,CAAA,EAEK,CAAA,CAAA,EAAK,EAAA,CACL,KAAA,UACA,SAAU,GACV,KAAO,UACP,CAAA,CAAA,EAEJ,CAAC,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACA,QAAA,qEACD,CAAA,CAAA,EAAe,EAA2B,CAC1C,OAAA,GACC,QAAO,GACP,MAAG,GACH,KAAI,UACJ,WAAI,CAAA,CACF,KAAC,UACD,KAAK,qCACN,QAAA,KACD,CAAA,CACD,KAAS,OACT,KAAM,SACN,QAAA,0DACC,CAAA,CACA,IAAA,UAAA,CACA,MAAA,CAAA,EAAA,EAAA,CACI,UAAS,CAAA,2BACb,IAAA,UAAY,CACV,MAAA,CAAA,EAAA,EAAA,CACM,IAAG,GACH,KAAG,aACP,KAAU,SACX,YAAA,CAAA,+EACD,CAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACM,UAAQ,CAAA,6BACR,SAAU,CAAA,iEACd,CAAA,CAAA,EAAqB,EAAW,EAAA,CAAA,CAAA,EAAU,EAAuB,CACnE,IAAA,GACA,KAAA,UACD,KAAY,SACV,YAAA,CAAA,MACC,CAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,MAAA,CAAA;;;;;;;;;;;uEAWA,EAAA,EAAA,CAAA,yEAAA,EAAA,EAAA,CAAA;;sBAEM,EAAM,EAAA,CAAA,mNAAA,CAAA,EAEb,CAAA,CAAA,EAAA,EAAA,CACA,IAAA,UAAS,CACT,MAAS,EAAA;;sCAEM,EAAA,EAAA,CAAA;;;;oCAIP,EAAA,EAAA,CAAA;;;;;;;;wGAUR,CAAC,CAAA,EAEL,CAAC,CAAC,EAEN,CAAC"}
|
|
@@ -1,98 +1,8 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
-
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
4
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
-
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
7
|
-
let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
|
|
8
|
-
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
9
|
-
let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
|
|
10
|
-
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
11
|
-
let _stryke_path = require("@stryke/path");
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@shell-shock/core/plugin-utils`),n=require(`@alloy-js/core`),r=require(`@alloy-js/typescript`),i=require(`@powerlines/deepkit/vendor/type`),a=require(`@powerlines/plugin-alloy/core`),o=require(`@powerlines/plugin-alloy/core/contexts/context`),s=require(`@powerlines/plugin-alloy/typescript`),c=require(`@powerlines/plugin-alloy/typescript/components/tsdoc`),l=require(`@stryke/path`);function u(){let u=(0,o.usePowerlines)(),d=(0,n.computed)(()=>(0,t.getAppBin)(u));return(0,e.createComponent)(s.TypescriptFile,{get path(){return(0,l.joinPaths)(u.entryPath,`completions`,`powershell`,`script`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS`,`SHELL_COMPLETIONS_DISPLAY`]},builtinImports:{console:[`bold`,`writeLine`,`success`,`warn`,`help`]},get children(){return[(0,e.createComponent)(c.TSDoc,{heading:`Options for the PowerShell Completions - Script command.`}),(0,e.createComponent)(r.InterfaceDeclaration,{export:!0,name:`PowerShellScriptCompletionsOptions`,get children(){return[(0,e.createComponent)(c.TSDoc,{heading:`Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.`,get children(){return(0,e.createComponent)(c.TSDocDefaultValue,{get type(){return i.ReflectionKind.boolean},defaultValue:!1})}}),(0,e.createComponent)(s.InterfaceMember,{name:`display`,optional:!0,type:`boolean`})]}}),(0,e.createComponent)(a.Spacing,{}),(0,e.createComponent)(c.TSDoc,{heading:"Handler logic for the \\`completions powershell script\\` command."}),(0,e.createComponent)(r.FunctionDeclaration,{export:!0,default:!0,async:!0,name:`handler`,get parameters(){return[{name:`options`,type:`PowerShellScriptCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"./${d.value}-completions.ps1"`}]},get children(){return[(0,e.createComponent)(r.IfStatement,{condition:n.code`options.display !== true`,get children(){return[(0,e.createComponent)(r.VarDeclaration,{const:!0,name:`scriptPath`,type:`string`,initializer:n.code` path.includes(".") ? \`\${path}.ps1\` : path;`}),(0,e.memo)(()=>n.code`await writeFile(scriptPath, \`# PowerShell script to add completions for ${(0,t.getAppTitle)(u)}\\n\\n\${SHELL_COMPLETIONS}\`);
|
|
12
2
|
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The PowerShell Completions - Script command's handler wrapper for the Shell Shock project.
|
|
16
|
-
*/
|
|
17
|
-
function PowerShellScriptCompletionsCommand() {
|
|
18
|
-
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
19
|
-
const bin = (0, _alloy_js_core.computed)(() => (0, _shell_shock_core_plugin_utils.getAppBin)(context));
|
|
20
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
|
|
21
|
-
get path() {
|
|
22
|
-
return (0, _stryke_path.joinPaths)(context.entryPath, "completions", "powershell", "script", "command.ts");
|
|
23
|
-
},
|
|
24
|
-
imports: {
|
|
25
|
-
"node:os": "os",
|
|
26
|
-
"node:path": ["join"],
|
|
27
|
-
"node:fs/promises": ["readFile", "writeFile"],
|
|
28
|
-
"../shared": ["SHELL_COMPLETIONS", "SHELL_COMPLETIONS_DISPLAY"]
|
|
29
|
-
},
|
|
30
|
-
builtinImports: { console: [
|
|
31
|
-
"bold",
|
|
32
|
-
"writeLine",
|
|
33
|
-
"success",
|
|
34
|
-
"warn",
|
|
35
|
-
"help"
|
|
36
|
-
] },
|
|
37
|
-
get children() {
|
|
38
|
-
return [
|
|
39
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the PowerShell Completions - Script command." }),
|
|
40
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
41
|
-
"export": true,
|
|
42
|
-
name: "PowerShellScriptCompletionsOptions",
|
|
43
|
-
get children() {
|
|
44
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
45
|
-
heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
|
|
46
|
-
get children() {
|
|
47
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
48
|
-
get type() {
|
|
49
|
-
return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
|
|
50
|
-
},
|
|
51
|
-
defaultValue: false
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
|
|
55
|
-
name: "display",
|
|
56
|
-
optional: true,
|
|
57
|
-
type: "boolean"
|
|
58
|
-
})];
|
|
59
|
-
}
|
|
60
|
-
}),
|
|
61
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
62
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`completions powershell script\\` command." }),
|
|
63
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
64
|
-
"export": true,
|
|
65
|
-
"default": true,
|
|
66
|
-
async: true,
|
|
67
|
-
name: "handler",
|
|
68
|
-
get parameters() {
|
|
69
|
-
return [{
|
|
70
|
-
name: "options",
|
|
71
|
-
type: "PowerShellScriptCompletionsOptions",
|
|
72
|
-
default: "{}"
|
|
73
|
-
}, {
|
|
74
|
-
name: "path",
|
|
75
|
-
type: "string",
|
|
76
|
-
default: `"./${bin.value}-completions.ps1"`
|
|
77
|
-
}];
|
|
78
|
-
},
|
|
79
|
-
get children() {
|
|
80
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
81
|
-
condition: _alloy_js_core.code`options.display !== true`,
|
|
82
|
-
get children() {
|
|
83
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
84
|
-
"const": true,
|
|
85
|
-
name: "scriptPath",
|
|
86
|
-
type: "string",
|
|
87
|
-
initializer: _alloy_js_core.code` path.includes(".") ? \`\${path}.ps1\` : path;`
|
|
88
|
-
}), (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`await writeFile(scriptPath, \`# PowerShell script to add completions for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)}\\n\\n\${SHELL_COMPLETIONS}\`);
|
|
89
|
-
|
|
90
|
-
success(\`${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} PowerShell completion script has been generated at \${bold(scriptPath)}.\`);`)];
|
|
91
|
-
}
|
|
92
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { get children() {
|
|
93
|
-
return _alloy_js_core.code`writeLine(" ------------------------------------------------- ");
|
|
3
|
+
success(\`${(0,t.getAppTitle)(u)} PowerShell completion script has been generated at \${bold(scriptPath)}.\`);`)]}}),(0,e.createComponent)(r.ElseClause,{get children(){return n.code`writeLine(" ------------------------------------------------- ");
|
|
94
4
|
writeLine("");
|
|
95
|
-
writeLine(\`# PowerShell completions for ${(0,
|
|
5
|
+
writeLine(\`# PowerShell completions for ${(0,t.getAppTitle)(u)}\`);
|
|
96
6
|
writeLine("");
|
|
97
7
|
SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
|
|
98
8
|
writeLine("");
|
|
@@ -102,14 +12,4 @@ function PowerShellScriptCompletionsCommand() {
|
|
|
102
12
|
help(\`To enable these completions, perform one of the following actions:
|
|
103
13
|
|
|
104
14
|
1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)
|
|
105
|
-
2) Save the above script to a file and source it from your shell configuration file \`);
|
|
106
|
-
} })];
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
//#endregion
|
|
115
|
-
exports.PowerShellScriptCompletionsCommand = PowerShellScriptCompletionsCommand;
|
|
15
|
+
2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}exports.PowerShellScriptCompletionsCommand=u;
|
|
@@ -1,97 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getAppBin, getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
3
|
-
import { code, computed } from "@alloy-js/core";
|
|
4
|
-
import { ElseClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, VarDeclaration } from "@alloy-js/typescript";
|
|
5
|
-
import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
6
|
-
import { Spacing } from "@powerlines/plugin-alloy/core";
|
|
7
|
-
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
8
|
-
import { InterfaceMember as InterfaceMember$1, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
|
|
9
|
-
import { TSDoc as TSDoc$1, TSDocDefaultValue as TSDocDefaultValue$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
10
|
-
import { joinPaths } from "@stryke/path";
|
|
1
|
+
import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{getAppBin as n,getAppTitle as r}from"@shell-shock/core/plugin-utils";import{code as i,computed as a}from"@alloy-js/core";import{ElseClause as o,FunctionDeclaration as s,IfStatement as c,InterfaceDeclaration as l,VarDeclaration as u}from"@alloy-js/typescript";import{ReflectionKind as d}from"@powerlines/deepkit/vendor/type";import{Spacing as f}from"@powerlines/plugin-alloy/core";import{usePowerlines as p}from"@powerlines/plugin-alloy/core/contexts/context";import{InterfaceMember as m,TypescriptFile as h}from"@powerlines/plugin-alloy/typescript";import{TSDoc as g,TSDocDefaultValue as _}from"@powerlines/plugin-alloy/typescript/components/tsdoc";import{joinPaths as v}from"@stryke/path";function y(){let y=p(),b=a(()=>n(y));return e(h,{get path(){return v(y.entryPath,`completions`,`powershell`,`script`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS`,`SHELL_COMPLETIONS_DISPLAY`]},builtinImports:{console:[`bold`,`writeLine`,`success`,`warn`,`help`]},get children(){return[e(g,{heading:`Options for the PowerShell Completions - Script command.`}),e(l,{export:!0,name:`PowerShellScriptCompletionsOptions`,get children(){return[e(g,{heading:`Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.`,get children(){return e(_,{get type(){return d.boolean},defaultValue:!1})}}),e(m,{name:`display`,optional:!0,type:`boolean`})]}}),e(f,{}),e(g,{heading:"Handler logic for the \\`completions powershell script\\` command."}),e(s,{export:!0,default:!0,async:!0,name:`handler`,get parameters(){return[{name:`options`,type:`PowerShellScriptCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"./${b.value}-completions.ps1"`}]},get children(){return[e(c,{condition:i`options.display !== true`,get children(){return[e(u,{const:!0,name:`scriptPath`,type:`string`,initializer:i` path.includes(".") ? \`\${path}.ps1\` : path;`}),t(()=>i`await writeFile(scriptPath, \`# PowerShell script to add completions for ${r(y)}\\n\\n\${SHELL_COMPLETIONS}\`);
|
|
11
2
|
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The PowerShell Completions - Script command's handler wrapper for the Shell Shock project.
|
|
15
|
-
*/
|
|
16
|
-
function PowerShellScriptCompletionsCommand() {
|
|
17
|
-
const context = usePowerlines();
|
|
18
|
-
const bin = computed(() => getAppBin(context));
|
|
19
|
-
return createComponent(TypescriptFile, {
|
|
20
|
-
get path() {
|
|
21
|
-
return joinPaths(context.entryPath, "completions", "powershell", "script", "command.ts");
|
|
22
|
-
},
|
|
23
|
-
imports: {
|
|
24
|
-
"node:os": "os",
|
|
25
|
-
"node:path": ["join"],
|
|
26
|
-
"node:fs/promises": ["readFile", "writeFile"],
|
|
27
|
-
"../shared": ["SHELL_COMPLETIONS", "SHELL_COMPLETIONS_DISPLAY"]
|
|
28
|
-
},
|
|
29
|
-
builtinImports: { console: [
|
|
30
|
-
"bold",
|
|
31
|
-
"writeLine",
|
|
32
|
-
"success",
|
|
33
|
-
"warn",
|
|
34
|
-
"help"
|
|
35
|
-
] },
|
|
36
|
-
get children() {
|
|
37
|
-
return [
|
|
38
|
-
createComponent(TSDoc$1, { heading: "Options for the PowerShell Completions - Script command." }),
|
|
39
|
-
createComponent(InterfaceDeclaration, {
|
|
40
|
-
"export": true,
|
|
41
|
-
name: "PowerShellScriptCompletionsOptions",
|
|
42
|
-
get children() {
|
|
43
|
-
return [createComponent(TSDoc$1, {
|
|
44
|
-
heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
|
|
45
|
-
get children() {
|
|
46
|
-
return createComponent(TSDocDefaultValue$1, {
|
|
47
|
-
get type() {
|
|
48
|
-
return ReflectionKind.boolean;
|
|
49
|
-
},
|
|
50
|
-
defaultValue: false
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}), createComponent(InterfaceMember$1, {
|
|
54
|
-
name: "display",
|
|
55
|
-
optional: true,
|
|
56
|
-
type: "boolean"
|
|
57
|
-
})];
|
|
58
|
-
}
|
|
59
|
-
}),
|
|
60
|
-
createComponent(Spacing, {}),
|
|
61
|
-
createComponent(TSDoc$1, { heading: "Handler logic for the \\`completions powershell script\\` command." }),
|
|
62
|
-
createComponent(FunctionDeclaration, {
|
|
63
|
-
"export": true,
|
|
64
|
-
"default": true,
|
|
65
|
-
async: true,
|
|
66
|
-
name: "handler",
|
|
67
|
-
get parameters() {
|
|
68
|
-
return [{
|
|
69
|
-
name: "options",
|
|
70
|
-
type: "PowerShellScriptCompletionsOptions",
|
|
71
|
-
default: "{}"
|
|
72
|
-
}, {
|
|
73
|
-
name: "path",
|
|
74
|
-
type: "string",
|
|
75
|
-
default: `"./${bin.value}-completions.ps1"`
|
|
76
|
-
}];
|
|
77
|
-
},
|
|
78
|
-
get children() {
|
|
79
|
-
return [createComponent(IfStatement, {
|
|
80
|
-
condition: code`options.display !== true`,
|
|
81
|
-
get children() {
|
|
82
|
-
return [createComponent(VarDeclaration, {
|
|
83
|
-
"const": true,
|
|
84
|
-
name: "scriptPath",
|
|
85
|
-
type: "string",
|
|
86
|
-
initializer: code` path.includes(".") ? \`\${path}.ps1\` : path;`
|
|
87
|
-
}), memo(() => code`await writeFile(scriptPath, \`# PowerShell script to add completions for ${getAppTitle(context)}\\n\\n\${SHELL_COMPLETIONS}\`);
|
|
88
|
-
|
|
89
|
-
success(\`${getAppTitle(context)} PowerShell completion script has been generated at \${bold(scriptPath)}.\`);`)];
|
|
90
|
-
}
|
|
91
|
-
}), createComponent(ElseClause, { get children() {
|
|
92
|
-
return code`writeLine(" ------------------------------------------------- ");
|
|
3
|
+
success(\`${r(y)} PowerShell completion script has been generated at \${bold(scriptPath)}.\`);`)]}}),e(o,{get children(){return i`writeLine(" ------------------------------------------------- ");
|
|
93
4
|
writeLine("");
|
|
94
|
-
writeLine(\`# PowerShell completions for ${
|
|
5
|
+
writeLine(\`# PowerShell completions for ${r(y)}\`);
|
|
95
6
|
writeLine("");
|
|
96
7
|
SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
|
|
97
8
|
writeLine("");
|
|
@@ -101,15 +12,5 @@ function PowerShellScriptCompletionsCommand() {
|
|
|
101
12
|
help(\`To enable these completions, perform one of the following actions:
|
|
102
13
|
|
|
103
14
|
1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)
|
|
104
|
-
2) Save the above script to a file and source it from your shell configuration file \`);
|
|
105
|
-
} })];
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
];
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
export { PowerShellScriptCompletionsCommand };
|
|
15
|
+
2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}export{y as PowerShellScriptCompletionsCommand};
|
|
115
16
|
//# sourceMappingURL=powershell-script-command.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powershell-script-command.mjs","names":[],"sources":["../../src/components/powershell-script-command.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocDefaultValue\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { getAppBin, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The PowerShell Completions - Script command's handler wrapper for the Shell Shock project.\n */\nexport function PowerShellScriptCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n const bin = computed(() => getAppBin(context));\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"powershell\",\n \"script\",\n \"command.ts\"\n )}\n imports={{\n \"node:os\": \"os\",\n \"node:path\": [\"join\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"],\n \"../shared\": [\"SHELL_COMPLETIONS\", \"SHELL_COMPLETIONS_DISPLAY\"]\n }}\n builtinImports={{\n console: [\"bold\", \"writeLine\", \"success\", \"warn\", \"help\"]\n }}>\n <TSDoc heading=\"Options for the PowerShell Completions - Script command.\" />\n <InterfaceDeclaration export name=\"PowerShellScriptCompletionsOptions\">\n <TSDoc heading=\"Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.\">\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"display\" optional type=\"boolean\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions powershell script\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"PowerShellScriptCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"./${bin.value}-completions.ps1\"`\n }\n ]}>\n <IfStatement condition={code`options.display !== true`}>\n <VarDeclaration\n const\n name=\"scriptPath\"\n type=\"string\"\n initializer={code` path.includes(\".\") ? \\`\\${path}.ps1\\` : path;`}\n />\n {code`await writeFile(scriptPath, \\`# PowerShell script to add completions for ${getAppTitle(context)}\\\\n\\\\n\\${SHELL_COMPLETIONS}\\`);\n\n success(\\`${getAppTitle(\n context\n )} PowerShell completion script has been generated at \\${bold(scriptPath)}.\\`);`}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`# PowerShell completions for ${getAppTitle(context)}\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\" ------------------------------------------------- \");\n\n writeLine(\"\");\n help(\\`To enable these completions, perform one of the following actions:\n\n 1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)\n 2) Save the above script to a file and source it from your shell configuration file \\`); `}\n </ElseClause>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"powershell-script-command.mjs","names":[],"sources":["../../src/components/powershell-script-command.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocDefaultValue\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { getAppBin, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The PowerShell Completions - Script command's handler wrapper for the Shell Shock project.\n */\nexport function PowerShellScriptCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n const bin = computed(() => getAppBin(context));\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"powershell\",\n \"script\",\n \"command.ts\"\n )}\n imports={{\n \"node:os\": \"os\",\n \"node:path\": [\"join\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"],\n \"../shared\": [\"SHELL_COMPLETIONS\", \"SHELL_COMPLETIONS_DISPLAY\"]\n }}\n builtinImports={{\n console: [\"bold\", \"writeLine\", \"success\", \"warn\", \"help\"]\n }}>\n <TSDoc heading=\"Options for the PowerShell Completions - Script command.\" />\n <InterfaceDeclaration export name=\"PowerShellScriptCompletionsOptions\">\n <TSDoc heading=\"Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.\">\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"display\" optional type=\"boolean\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions powershell script\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"PowerShellScriptCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"./${bin.value}-completions.ps1\"`\n }\n ]}>\n <IfStatement condition={code`options.display !== true`}>\n <VarDeclaration\n const\n name=\"scriptPath\"\n type=\"string\"\n initializer={code` path.includes(\".\") ? \\`\\${path}.ps1\\` : path;`}\n />\n {code`await writeFile(scriptPath, \\`# PowerShell script to add completions for ${getAppTitle(context)}\\\\n\\\\n\\${SHELL_COMPLETIONS}\\`);\n\n success(\\`${getAppTitle(\n context\n )} PowerShell completion script has been generated at \\${bold(scriptPath)}.\\`);`}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`# PowerShell completions for ${getAppTitle(context)}\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\" ------------------------------------------------- \");\n\n writeLine(\"\");\n help(\\`To enable these completions, perform one of the following actions:\n\n 1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)\n 2) Save the above script to a file and source it from your shell configuration file \\`); `}\n </ElseClause>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":"gwBA+BA,SAAE,GAAA,CACA,IAAM,EAAC,GAAwB,CAC1B,EAAA,MAAA,EAAA,EAAA,CAAA,CACL,OAAK,EAAA,EAAA,CACL,IAAA,MAAA,CACI,OAAG,EAAW,EAAO,UAAM,cAAsB,aAAM,SAAA,aAAA,EAE7D,QAAS,CACH,UAAQ,0BAEZ,mBAAA,CAAA,WAAA,YAAA,CACI,YAAY,CAAA,oBAAqB,4BAA8B,CACnE,CACF,eAAgB,CACd,QAAa,CAAC,OAAE,YAAc,UAAA,OAAwB,OAAG,CAAA,CAEzD,IAAM,UAAM,aAEN,QAAC,2DACJ,CAAA,CAAA,EAAA,EAAA,CACC,OAAM,GACJ,KAAA,qCACA,IAAC,UAAY,CACZ,MAAA,CAAA,EAAW,EAAA,CACX,QAAO,6LACP,IAAO,UAAG,CACZ,OAAA,EAAA,EAAA,CACQ,IAAA,MAAA,CACG,OAAK,EAAA,SAEP,aAAc,GAClB,CAAA,EAEN,CAAA,CAAA,EAAgB,EAAA,CACd,KAAU,UACV,SAAA,GACI,KAAC,UACN,CAAA,CAAA,EAEA,CAAC,CAAE,EAAC,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACH,QAAS,qEACV,CAAC,CAAE,EAAgB,EAAK,CACvB,OAAG,GACH,QAAO,GACP,MAAC,GACD,KAAA,UACD,IAAA,YAAS,CACT,MAAM,CAAA,CACN,KAAA,UACC,KAAA,qCACA,QAAA,KACA,CAAA,CACI,KAAE,OACN,KAAU,SACR,QAAA,MAAA,EAAA,MAAA,mBACC,CAAC,EAEJ,IAAI,UAAW,CACb,MAAC,CAAA,EAAA,EAAA,CACD,UAAA,CAAA,2BACE,IAAI,UAAQ,CACZ,MAAO,CAAA,EAAO,EAAA,CACd,MAAa,GACf,KAAA,aACA,KAAA,SACD,YAAY,CAAW,iDACrB,CAAA,CAAA,MAAA,CAAA,4EAAA,EAAA,EAAA,CAAA;;wBAEO,EAAU,EAAA,CAAA,+EAAA,CAAA,EAEjB,CAAC,CAAA,EAAmB,EAAa,CACjC,IAAA,UAAA,CACA,MAAU,EAAC;;uDAEa,EAAA,EAAA,CAAA;;;;;;;;;;4GAc5B,CAAC,CAAC,EAEN,CAAC"}
|