fix: errors in destroy space & create space next to current
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user