Skip to content

Commit

Permalink
Refactored core to prepare for full implementation of #1.
Browse files Browse the repository at this point in the history
  • Loading branch information
icasimpan committed Mar 2, 2022
1 parent 7489be2 commit 5d0df3b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
22 changes: 20 additions & 2 deletions readme.md
Expand Up @@ -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
Expand All @@ -77,7 +77,7 @@ a `postgres` service:
```
~$ pwd
/my/work/projects/docktie/utils
~$ cp artisan postgres
~$ ln -s shell postgres
## ...
## ...
## ...
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions utils/artisan

This file was deleted.

1 change: 1 addition & 0 deletions utils/artisan
3 changes: 0 additions & 3 deletions utils/composer

This file was deleted.

1 change: 1 addition & 0 deletions utils/composer
File renamed without changes.
3 changes: 0 additions & 3 deletions utils/mysql

This file was deleted.

1 change: 1 addition & 0 deletions utils/mysql
3 changes: 0 additions & 3 deletions utils/npm

This file was deleted.

1 change: 1 addition & 0 deletions utils/npm
2 changes: 1 addition & 1 deletion utils/shell
@@ -1,3 +1,3 @@
#!/bin/bash

core $(basename $0) $*
$(dirname $0)/kernel/core $(basename $0) $*

0 comments on commit 5d0df3b

Please sign in to comment.