fix: errors in destroy space & create space next to current

This commit is contained in:
2026-04-09 19:10:33 -04:00
Unverified
parent 30f51703d2
commit 93a340693d
2 changed files with 15 additions and 17 deletions

View File

@@ -4,23 +4,12 @@ import { showFailureToast } from "@raycast/utils";
export default async function Command() {
try {
const { stdout: rawRecentSpace, stderr } = await runYabaiCommand(`-m query --spaces --space recent`);
const { stderr } = await runYabaiCommand(`-m space --destroy`);
if (stderr) {
throw new Error(stderr);
}
const recentSpace = JSON.parse(rawRecentSpace);
const lastSpaceIndex = recentSpace.index;
await runYabaiCommand(`-m space --destroy`);
try {
await runYabaiCommand(`-m space --focus ${lastSpaceIndex}`);
} catch (error) {
throw new Error(`Failed to focus space: ${error}`);
}
await showHUD(`Destroyed Space`);
} catch (error) {
if (error instanceof Error) {