Skip to content

Commit 70201cd

Browse files
sf aliases
1 parent c4beeb4 commit 70201cd

File tree

1 file changed

+63
-6
lines changed

1 file changed

+63
-6
lines changed

opt/profiles/.bash_aliases

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,70 @@ alias cursor='/Applications/Cursor.app/Contents/MacOS/Cursor'
227227
function sfhelp() {
228228
echo "Help with sf ws commands:"
229229
cat <<'EOF'
230-
sf ws create --os rocky9 --name gco2 --customization off
231-
sf ws create --os rocky9 --name gco2
232-
sf ws code gco --dir /home/eraigosa/github/snowflakedb/release-orchestration-service --ide cursor
230+
sflist - list all workspaces, alias for "sf ws ls"
231+
232+
sfssh - ssh to the workspace, alias for "sf ws ssh gco2"
233+
234+
sfcreate - create a new workspace, alias for "sf ws create --os rocky9 --name gco2 --customization off"
235+
usage: sfcreate [-nc] [-nr] [<name>]
236+
-nc - no customization, default is customization on
237+
-nr - no rocky9, default is rocky9
238+
<name> - name of the workspace, default is gco2
239+
240+
sfcode - code editor for the workspace, alias for "sf ws code gco2 --dir /home/eraigosa/github/snowflakedb/release-orchestration-service --ide cursor"
241+
usage: sfcode [-d <directory>] [<name>]
242+
-d <directory> - directory to open in the code editor, default is ~/github/snowflakedb/release-orchestration-service
243+
<name> - name of the workspace, default is gco2
244+
233245
EOF
234246
}
235-
alias sfcreate='sf ws create --os rocky9 --name'
247+
248+
function sfcode() {
249+
local NAME="gco2"
250+
local DIR=~/github/snowflakedb/release-orchestration-service
251+
local NO_CUSTOMIZATION=
252+
local ROCKY9=--os rocky9
253+
254+
while [[ $# -gt 0 ]]; do
255+
case "$1" in
256+
-d)
257+
DIR="$2"
258+
shift 2
259+
;;
260+
*)
261+
NAME="$1"
262+
shift
263+
;;
264+
esac
265+
done
266+
267+
sf ws code ${NAME} --dir ${DIR} --ide cursor
268+
}
269+
270+
function sfcreate() {
271+
local NAME="gco2"
272+
local NO_CUSTOMIZATION=
273+
local ROCKY9=--os rocky9
274+
275+
while [[ $# -gt 0 ]]; do
276+
case "$1" in
277+
-nr)
278+
ROCKY9=
279+
shift
280+
;;
281+
-nc)
282+
NO_CUSTOMIZATION=--customization off
283+
shift
284+
;;
285+
*)
286+
NAME="$1"
287+
shift
288+
;;
289+
esac
290+
done
291+
292+
sf ws create ${ROCKY9} --name ${NAME} ${NO_CUSTOMIZATION}
293+
}
294+
236295
alias sfssh='sf ws ssh'
237-
alias sfcode='sf ws code --dir ~/github/snowflakedb/release-orchestration-service --ide cursor'
238296
alias sfls='sf ws ls'
239-
alias sfcreateno='sf ws create --os rocky9 --customization off --name'

0 commit comments

Comments
 (0)