diff --git a/readme.md b/readme.md index c6ffcbb..9ff30ad 100644 --- a/readme.md +++ b/readme.md @@ -68,7 +68,7 @@ DockTie Dev Helper exited. # Utils Customization -The `utils` are inside "utils" directory. Focus only on the core script `utils/core`. +The `utils` are inside "utils" directory. Focus only on the core script `utils/kernel/core`. This was initially made for a laravel project. Follow the pattern in core and add the corresponding service. For example, if you have @@ -77,7 +77,7 @@ a `postgres` service: ``` ~$ pwd /my/work/projects/docktie/utils -~$ cp artisan postgres +~$ ln -s shell postgres ## ... ## ... ## ... @@ -88,6 +88,24 @@ a `postgres` service: ## ;; ## ``` + +Notice that in majority of utils, only shell (utils/shell) is actually calling the core (utils/kernel/core). +This is because, only the script name matters. + +``` +~$ nl -ba utils/shell + 1 #!/bin/bash + 2 + 3 $(dirname $0)/kernel/core $(basename $0) $* +``` + +In line 3 above, +``` +$(basename $0) +``` +is the script name which works for symbolic links too. This makes maintenance easier and can be automated later +when the enhancement issue "#1 (Possible decoupling of services handled)" is fully implemented. + Test and enjoy! # Limitation diff --git a/utils/artisan b/utils/artisan deleted file mode 100644 index 858f1fc..0000000 --- a/utils/artisan +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -core $(basename $0) $* diff --git a/utils/artisan b/utils/artisan new file mode 120000 index 0000000..03e813f --- /dev/null +++ b/utils/artisan @@ -0,0 +1 @@ +shell \ No newline at end of file diff --git a/utils/composer b/utils/composer deleted file mode 100644 index 858f1fc..0000000 --- a/utils/composer +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -core $(basename $0) $* diff --git a/utils/composer b/utils/composer new file mode 120000 index 0000000..03e813f --- /dev/null +++ b/utils/composer @@ -0,0 +1 @@ +shell \ No newline at end of file diff --git a/utils/core b/utils/kernel/core similarity index 100% rename from utils/core rename to utils/kernel/core diff --git a/utils/mysql b/utils/mysql deleted file mode 100644 index 858f1fc..0000000 --- a/utils/mysql +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -core $(basename $0) $* diff --git a/utils/mysql b/utils/mysql new file mode 120000 index 0000000..03e813f --- /dev/null +++ b/utils/mysql @@ -0,0 +1 @@ +shell \ No newline at end of file diff --git a/utils/npm b/utils/npm deleted file mode 100644 index 858f1fc..0000000 --- a/utils/npm +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -core $(basename $0) $* diff --git a/utils/npm b/utils/npm new file mode 120000 index 0000000..03e813f --- /dev/null +++ b/utils/npm @@ -0,0 +1 @@ +shell \ No newline at end of file diff --git a/utils/shell b/utils/shell index 858f1fc..ab2d547 100644 --- a/utils/shell +++ b/utils/shell @@ -1,3 +1,3 @@ #!/bin/bash -core $(basename $0) $* +$(dirname $0)/kernel/core $(basename $0) $*