Skip to content

Commit 94e8f6a

Browse files
unnameddPitNikola
authored andcommitted
Convert Search Script Command to a shell file
to make possible the compilation of the Swift file
1 parent 9c81de8 commit 94e8f6a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# Dependency: This script requires `swift` installed.
4+
# Install via https://swift.org/download/
5+
6+
# Required parameters:
7+
# @raycast.schemaVersion 1
8+
# @raycast.title Search Script Command (Bash)
9+
# @raycast.mode fullOutput
10+
# @raycast.packageName Searches
11+
#
12+
# Optional parameters:
13+
# @raycast.author Thiago Holanda
14+
# @raycast.authorURL https://twitter.com/tholanda
15+
# @raycast.icon 🔎
16+
# @raycast.description Search for Script Commands available in the Raycast repository
17+
# @raycast.argument1 { "type": "text", "placeholder": "Query"}
18+
19+
# Files related to this Script Command:
20+
# - search-script-command.sh (this file)
21+
# - search-script-command.swift
22+
# - search-script-command (this binary file will be generated by swiftc)
23+
24+
filename=${0##*/}
25+
basename=${filename%.*}
26+
swift_filename="$basename.swift"
27+
28+
if [ ! -f $basename ] && [ -f $swift_filename ]; then
29+
$(swiftc $swift_filename -emit-executable -o $basename)
30+
fi
31+
32+
./$basename "$1"

0 commit comments

Comments
 (0)