Skip to content

Commit 151d5c3

Browse files
committed
chore: refactor exports
1 parent d55ac00 commit 151d5c3

File tree

4 files changed

+10
-26
lines changed

4 files changed

+10
-26
lines changed

src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { commands, type ExtensionContext } from "vscode";
22
import { createTask } from "./task";
33
import { generate } from "./pynsist";
44

5-
async function activate(context: ExtensionContext): Promise<void> {
5+
export async function activate(context: ExtensionContext): Promise<void> {
66
context.subscriptions.push(
77
commands.registerTextEditorCommand("extension.pynsist.generate", () => {
88
generate(false);
@@ -22,5 +22,3 @@ async function activate(context: ExtensionContext): Promise<void> {
2222
),
2323
);
2424
}
25-
26-
export { activate };

src/pynsist.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const channel = window.createOutputChannel("pynsist");
2020
* https://pypi.python.org/pypi/pynsist
2121
* https://github.com/takluyver/pynsist
2222
*/
23-
async function generate(runMakensis: boolean): Promise<void> {
23+
export async function generate(runMakensis: boolean): Promise<void> {
2424
await clearOutput(channel);
2525

2626
const doc = window?.activeTextEditor?.document;
@@ -133,5 +133,3 @@ async function generate(runMakensis: boolean): Promise<void> {
133133
.catch(pathWarning);
134134
});
135135
}
136-
137-
export { generate };

src/task.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { mkdir, writeFile } from "fs";
55
import { workspace, window } from "vscode";
66
import { getPath, sanitize } from "./util";
77

8-
async function createTask(): Promise<void> {
8+
export async function createTask(): Promise<void> {
99
if (
1010
typeof workspace.workspaceFolders === "undefined" ||
1111
workspace.workspaceFolders.length < 1
@@ -67,5 +67,3 @@ async function createTask(): Promise<void> {
6767
window.showErrorMessage(error.toString());
6868
});
6969
}
70-
71-
export { createTask };

src/util.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { spawn } from "child_process";
77
import { window, type OutputChannel } from "vscode";
88
import open from "open";
99

10-
async function clearOutput(channel: OutputChannel): Promise<void> {
10+
export async function clearOutput(channel: OutputChannel): Promise<void> {
1111
const { alwaysShowOutput } = await getConfig("pynsist");
1212

1313
channel.clear();
@@ -16,7 +16,7 @@ async function clearOutput(channel: OutputChannel): Promise<void> {
1616
}
1717
}
1818

19-
async function detectOutput(
19+
export async function detectOutput(
2020
relativePath: string,
2121
line: string,
2222
needle: DetectOutputOptions,
@@ -48,11 +48,11 @@ async function fileExists(filePath: string): Promise<boolean> {
4848
return true;
4949
}
5050

51-
function getPrefix(): string {
51+
export function getPrefix(): string {
5252
return platform() === "win32" ? "/" : "-";
5353
}
5454

55-
async function getPath(): Promise<string | number> {
55+
export async function getPath(): Promise<string | number> {
5656
const pathToPynsist = (await getConfig("pynsist.pathToPynsist")) || "pynsist";
5757

5858
return new Promise((resolve, reject) => {
@@ -82,7 +82,7 @@ async function getPath(): Promise<string | number> {
8282
});
8383
}
8484

85-
function pathWarning(): void {
85+
export function pathWarning(): void {
8686
window
8787
.showWarningMessage(
8888
"pynsist is not installed or missing in your PATH environment variable",
@@ -102,7 +102,7 @@ function pathWarning(): void {
102102
});
103103
}
104104

105-
async function runInstaller(outFile: string): Promise<void> {
105+
export async function runInstaller(outFile: string): Promise<void> {
106106
const { useWineToRun } = getConfig("pynsist");
107107

108108
if (platform() === "win32") {
@@ -113,16 +113,6 @@ async function runInstaller(outFile: string): Promise<void> {
113113
}
114114
}
115115

116-
function sanitize(response: string): string {
116+
export function sanitize(response: string): string {
117117
return response.toString().trim();
118118
}
119-
120-
export {
121-
clearOutput,
122-
detectOutput,
123-
getPrefix,
124-
getPath,
125-
pathWarning,
126-
runInstaller,
127-
sanitize,
128-
};

0 commit comments

Comments
 (0)