tunestra 0.1.0 → 0.1.1
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/dist/cli.mjs +12 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-DSbrKtiC.mjs → src-Dmt0_5_W.mjs} +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as VERSION } from "./src-
|
|
2
|
+
import { t as VERSION } from "./src-Dmt0_5_W.mjs";
|
|
3
3
|
import { Command } from "@commander-js/extra-typings";
|
|
4
4
|
import pc from "picocolors";
|
|
5
5
|
import { copyFile, lstat, mkdir, readFile, readdir, readlink, rename, rm, rmdir, stat, symlink, unlink, writeFile } from "node:fs/promises";
|
|
@@ -143,6 +143,15 @@ async function readFileIfExists(path) {
|
|
|
143
143
|
throw error;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
/** Removes a directory only when it has nothing inside; a missing directory is fine too. */
|
|
147
|
+
async function removeDirIfEmpty(dir) {
|
|
148
|
+
try {
|
|
149
|
+
if ((await readdir(dir)).length === 0) await rmdir(dir);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
if (isMissingPathError(error)) return;
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
146
155
|
//#endregion
|
|
147
156
|
//#region src/shared/constants/agents.ts
|
|
148
157
|
/** Agents that tunestra generates configuration for. */
|
|
@@ -1815,12 +1824,14 @@ async function runUninstall(projectDir, options) {
|
|
|
1815
1824
|
warnings
|
|
1816
1825
|
};
|
|
1817
1826
|
const stateDir = join(projectDir, STATE_DIR);
|
|
1827
|
+
const tunestraDir = join(projectDir, PROJECT_DIR);
|
|
1818
1828
|
await removeOutputs(projectDir, removals);
|
|
1819
1829
|
await removeGitignoreBlockFile(projectDir);
|
|
1820
1830
|
await rm(stateDir, {
|
|
1821
1831
|
recursive: true,
|
|
1822
1832
|
force: true
|
|
1823
1833
|
});
|
|
1834
|
+
await removeDirIfEmpty(tunestraDir);
|
|
1824
1835
|
return {
|
|
1825
1836
|
removals,
|
|
1826
1837
|
warnings
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as VERSION } from "./src-
|
|
1
|
+
export { t as VERSION } from "./src-Dmt0_5_W.mjs";
|
package/package.json
CHANGED