From e8f28f72d98ba26174ad2930aca8d15063fff6e0 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sat, 16 Aug 2025 00:41:07 +0800 Subject: [PATCH] update --- .gitignore | 2 ++ js/ls.ts | 18 ++++++++++++++++++ sh/open-directory.sh | 36 ++++++++++++++++++++++++++++++++++++ sh/open-file.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 .gitignore create mode 100755 js/ls.ts create mode 100755 sh/open-directory.sh create mode 100755 sh/open-file.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..28f1ba7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +.DS_Store \ No newline at end of file diff --git a/js/ls.ts b/js/ls.ts new file mode 100755 index 0000000..017441a --- /dev/null +++ b/js/ls.ts @@ -0,0 +1,18 @@ +#!/usr/bin/env /Users/xion/.nvm/versions/node/v24.5.0/bin/bun + +// Required parameters: +// @raycast.schemaVersion 1 +// @raycast.title ls +// @raycast.mode fullOutput + +// Optional parameters: +// @raycast.icon 🤖 +// @raycast.packageName @kevisual/raycast + +// Documentation: +// @raycast.description ls +// @raycast.author abearxiong +// @raycast.authorURL https://raycast.com/abearxiong + +console.log("Hello World!") + diff --git a/sh/open-directory.sh b/sh/open-directory.sh new file mode 100755 index 0000000..5829d5c --- /dev/null +++ b/sh/open-directory.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title open-directory +# @raycast.mode compact + +# Optional parameters: +# @raycast.icon 🤖 +# @raycast.packageName @kevisual/raycast + +# Documentation: +# @raycast.description open +# @raycast.author abearxiong +# @raycast.authorURL https://raycast.com/abearxiong + +# 获取访达当前窗口路径 +finder_path=$(osascript < 0 then + set thePath to POSIX path of (item 1 of sel as alias) + return thePath + else + set thePath to POSIX path of (target of front window as alias) + return thePath + end if + on error + return "" + end try +end tell +EOF +) + +if [[ -z "$finder_path" ]]; then + echo "没有检测到访达窗口或选中文件" + exit 1 +fi + +open -a "Visual Studio Code" "$finder_path" \ No newline at end of file