Skip to content

Commit 2466df5

Browse files
committed
Add macOS script to run websites as tabs in iTerm2
1 parent 324c859 commit 2466df5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"now-build": "yarn run static-$TARGET",
88
"clean": "git clean -X -f -d",
9+
"dev-all": "./run-dev-all.sh",
910
"dev-archetype-web": "yarn --cwd packages/archetype-web dev -p 3001",
1011
"dev-skoleni-docker.cz": "yarn --cwd packages/skoleni-docker.cz dev -p 3002",
1112
"dev-skoleni-kubernetes.cz": "yarn --cwd packages/skoleni-kubernetes.cz dev -p 3003",

run-dev-all.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
# macOS only
3+
4+
newtab() {
5+
osascript \
6+
-e 'tell application "iTerm2" to tell current window to set newWindow to (create tab with default profile)'\
7+
-e "tell application \"iTerm2\" to tell current session of newWindow to write text \"${@}\""
8+
}
9+
10+
if [ -z $1 ];
11+
then
12+
for SITE in $(cat sites.txt)
13+
do
14+
newtab "yarn run dev-$SITE"
15+
done
16+
else
17+
for SITE in $(cat sites.txt | grep $1)
18+
do
19+
newtab "yarn run dev-$SITE"
20+
done
21+
fi

0 commit comments

Comments
 (0)