Skip to content

Commit

Permalink
update one-liner and todos
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinKonowalczyk committed Dec 14, 2021
1 parent 55ce27a commit 5fc2c69
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Add the keybinding to `keybindings.json`, then in your project make the .vscode

```
[ -d ".vscode" ] || mkdir ".vscode"
SOURCE="https://gist.githubusercontent.com/MarcinKonowalczyk/709e93f08e9d72f8092acd5b8d34c81f/raw/2a1de7e14c654f48c1cdfd8ab50fe00d067c0024/run.sh"
SOURCE="https://raw.githubusercontent.com/MarcinKonowalczyk/run_sh/master/run.sh"
curl $SOURCE > .vscode/run.sh
chmod u+x ./.vscode/run.sh
```

## one-liner

```
[ -d ".vscode" ] || mkdir ".vscode"; curl https://gist.githubusercontent.com/MarcinKonowalczyk/709e93f08e9d72f8092acd5b8d34c81f/raw/2a1de7e14c654f48c1cdfd8ab50fe00d067c0024/run.sh > .vscode/run.sh && chmod u+x ./.vscode/run.sh
[ -d ".vscode" ] || mkdir ".vscode"; curl https://raw.githubusercontent.com/MarcinKonowalczyk/run_sh/master/run.sh > .vscode/run.sh && chmod u+x ./.vscode/run.sh
```

## test
Expand All @@ -27,7 +27,7 @@ chmod u+x ./.vscode/run.sh
cd ~
mkdir test
cd test
[ -d ".vscode" ] || mkdir ".vscode"; curl https://gist.githubusercontent.com/MarcinKonowalczyk/709e93f08e9d72f8092acd5b8d34c81f/raw/2a1de7e14c654f48c1cdfd8ab50fe00d067c0024/run.sh > .vscode/run.sh && chmod u+x ./.vscode/run.sh
[ -d ".vscode" ] || mkdir ".vscode"; curl https://raw.githubusercontent.com/MarcinKonowalczyk/run_sh/master/run.sh > .vscode/run.sh && chmod u+x ./.vscode/run.sh
touch hi.txt
code hi.txt
```
Expand All @@ -47,7 +47,8 @@ EXTENSION : sh # just the extension of the current file
ROOTFOLDER : <same as FILEFOLDER>
```

## todos
# todos

- [ ] automatically update links on push
- [ ] one-liner to update to a new version (diff with one from /stable/)
- [ ] ? run.fish / run.zsh
- [ ] ? script which automatically adds keyboard shortcut to keybindings.json
- [ ] ? find a workaround for something already running in the terminal (e.g. python/julia repl)
11 changes: 5 additions & 6 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# https://gist.github.com/MarcinKonowalczyk/709e93f08e9d72f8092acd5b8d34c81f
# Example .run.sh
# https://github.com/MarcinKonowalczyk/run_sh
# Bash script run by a keboard shortcut, called with rteh current file path $1
# This is intended as an exmaple, but also contains a bunch of useful path partitions
# Feel free to delete everything in
echo "Hello from run script! ^_^"

# The direcotry of the main project from which this script is running
Expand All @@ -22,10 +24,7 @@ ROOTFOLDER="${1##*$ROOT/}" && ROOTFOLDER="${ROOTFOLDER%%/*}" # folder in the roo
# Echo of path variables
# VERBOSE=true
VERBOSE=false

if [ "$FILEFOLDER" = ".vscode" ] && [ "$FILENAME" = "run.sh" ]; then
VERBOSE=true
fi
[ "$FILEFOLDER" = ".vscode" ] && [ "$FILENAME" = "run.sh" ] && VERBOSE=true

if $VERBOSE; then
# https://stackoverflow.com/a/5947802/2531987
Expand Down

0 comments on commit 5fc2c69

Please sign in to comment.