Skip to content

Commit 806d446

Browse files
authored
Merge pull request #10 from chvolkmann/chvolkmann/issue9
Unify installers
2 parents f39dc64 + 20a536b commit 806d446

File tree

7 files changed

+25
-11
lines changed

7 files changed

+25
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ With [fisher](https://github.com/jorgebucaran/fisher)
4343
fisher install chvolkmann/code-connect
4444
```
4545

46-
This downloads [`code_connect.py`](./functions/code_connect.py) along with two functions. See [`functions/code.fish`](./functions/code.fish) and [`functions/code-connect.fish`](./functions/code-connect.fish)
46+
This downloads [`code_connect.py`](./bin/code_connect.py) along with two functions. See [`functions/code.fish`](./functions/code.fish) and [`functions/code-connect.fish`](./functions/code-connect.fish)
4747

4848
You can autocomplete the repository name in subsequent commands, e.g. `fisher update code<TAB>`
4949

@@ -69,7 +69,7 @@ With [`bash/install.sh`](./bash/install.sh)
6969
curl -sS https://raw.githubusercontent.com/chvolkmann/code-connect/main/bash/install.sh | bash
7070
```
7171

72-
This downloads [`code_connect.py`](./functions/code_connect.py) along with two scripts and sets up aliases in your `.bashrc` for you. See [`bash/code.sh`](./bash/code.sh) and [`bash/code-connect.sh`](./bash/code-connect.sh)
72+
This downloads [`code_connect.py`](./bin/code_connect.py) along with two scripts and sets up aliases in your `.bashrc` for you. See [`bash/code.sh`](./bash/code.sh) and [`bash/code-connect.sh`](./bash/code-connect.sh)
7373

7474
#### Uninstalling
7575

bash/code-connect.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55
# Use this script through an alias
66
# alias code-connect="/path/to/code-connect.sh"
77

8-
_CODE_CONNECT_PY="$(dirname \"$0\")"/code_connect.py
9-
$_CODE_CONNECT_PY $@
8+
~/.code-connect/bin/code_connect.py $@

bash/code.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ if test -n "$local_code_executable"; then
1111
$local_code_executable $@
1212
else
1313
# code not locally installed, use code-connect
14-
code-connect $@
14+
~/.code-connect/bin/code_connect.py $@
1515
fi

bash/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ print ""
8686

8787
# Download the required files from the repository
8888

89-
mkdir -p "$CODE_CONNECT_INSTALL_DIR/lib"
89+
mkdir -p "$CODE_CONNECT_INSTALL_DIR/bin"
9090

91-
CODE_CONNECT_PY="$CODE_CONNECT_INSTALL_DIR/lib/code_connect.py"
91+
CODE_CONNECT_PY="$CODE_CONNECT_INSTALL_DIR/bin/code_connect.py"
9292
download-repo-file "functions/code_connect.py" $CODE_CONNECT_PY
9393
chmod +x "$CODE_CONNECT_PY"
9494

File renamed without changes.

conf.d/code-connect.fish

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/fish
2+
3+
# https://github.com/chvolkmann/code-connect
4+
5+
function _on_code-connect_install --on-event code-connect_install
6+
mkdir -p ~/.code-connect/bin
7+
curl -sS "https://raw.githubusercontent.com/chvolkmann/code-connect/main/bin/code_connect.py" >~/.code-connect/bin/code_connect.py
8+
chmod +x ~/.code-connect/bin/code_connect.py
9+
end
10+
11+
function _on_code-connect_update --on-event code-connect_update
12+
_on_code-connect_install
13+
end
14+
15+
function _on_code-connect_uninstall --on-event code-connect_uninstall
16+
rm -rf ~/.code-connect
17+
end

functions/code-connect.fish

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# https://github.com/chvolkmann/code-connect
44

55
function code-connect --description 'Run Visual Studio Code through code-connect'
6-
# absolute path to code_connect.py
7-
set -l _CODE_CONNECT_PY (dirname (realpath (status --current-filename)))/code_connect.py
8-
9-
$_CODE_CONNECT_PY $argv
6+
# alias for code_connect.py
7+
~/.code-connect/bin/code_connect.py $argv
108
end

0 commit comments

Comments
 (0)