This repository was archived by the owner on Jul 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,13 @@ $ curl -# -L https://github.com/svandragt/php-activate/tarball/main | tar -xz --
24
24
Add the following line to your shell rc script:
25
25
26
26
```
27
- source $HOME/opt/php-activate/php-activate.sh # or your place of choice
27
+ # Fish
28
+ source $HOME/opt/php-activate/php-activate.fish
29
+ # Bash or ZSH:
30
+ source $HOME/opt/php-activate/php-activate.sh
28
31
```
29
32
33
+
30
34
## Run examples
31
35
32
36
``` shell
Original file line number Diff line number Diff line change
1
+ # !/usr/bin/env fish
2
+
3
+ function php-activate
4
+ if not test -z $argv [1]
5
+ set php_versions (update-alternatives --query php | grep Alternative | cut -d ' ' -f2 )
6
+ if string match " *$argv [1]" $php_versions
7
+ set -xg PHP_PICKED (string match " *$argv [1]" $php_versions | head -n 1)
8
+ function php
9
+ $PHP_PICKED $argv
10
+ end
11
+ echo " Activated: $PHP_PICKED "
12
+ php --version | grep built
13
+ else
14
+ echo " Error: No matching PHP version found. Use one of the following:"
15
+ echo " $php_versions "
16
+ end
17
+ return
18
+ end
19
+
20
+ if not test -z $PHP_PICKED
21
+ echo " Deactivated: $PHP_PICKED "
22
+ set -e PHP_PICKED
23
+ functions -e php
24
+ php --version | grep built
25
+ return
26
+ end
27
+ end
You can’t perform that action at this time.
0 commit comments