File tree 2 files changed +22
-3
lines changed
2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ Clone this repository into your Magento folder. Remember not to commit it.
31
31
32
32
You can also do this, athough you shouldn't. It will install it under ` ./script_runner ` .
33
33
``` shell script
34
- sh -c " $( curl -SsfL https://raw.githubusercontent.com/marcusirgens/magento2-script-runner/main/install.sh) "
34
+ bash -c " $( curl -SsfL https://raw.githubusercontent.com/marcusirgens/magento2-script-runner/main/install.sh) "
35
35
```
36
36
37
37
If you're in your Magento 2 application directory at ` /my/code/folder ` ,
Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /bin/bash
2
+ # Simple installer for the script runner
2
3
3
- set -eux
4
+ # https://www.davidpashley.com/articles/writing-robust-shell-scripts/
5
+ set -eu
4
6
7
+ # Clone and remove git directory
8
+ # https://stackoverflow.com/a/11498124/9738360
5
9
git clone --depth=1 --branch=main git@github.com:marcusirgens/magento2-script-runner.git ./script_runner
6
10
rm -rf ./script_runner/.git
11
+
12
+ # Get the global gitignore
13
+ global_ignore=" $( git config --global --get core.excludesfile) "
14
+
15
+ # If that file does not exist, don't do anything.
16
+ if [ -n " $global_ignore " ]; then
17
+ if ! grep -Eq ' ^script_runner.*' " $global_ignore " ; then
18
+ # https://stackoverflow.com/questions/1885525/how-do-i-prompt-a-user-for-confirmation-in-bash-script
19
+ read -p " Do you want to add script_runner/* to your global .gitignore file? [y/n]" -n 1 -r
20
+ echo # (optional) move to a new line
21
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
22
+ echo " script_runner/*" >> " $global_ignore "
23
+ fi
24
+ fi
25
+ fi
You can’t perform that action at this time.
0 commit comments