From 6d04baf7665c610778d69c79b97acacda3a40136 Mon Sep 17 00:00:00 2001 From: Tony Messias Date: Mon, 30 Oct 2023 22:22:20 -0300 Subject: [PATCH 1/3] Adds a WIP version of the bin/importmap file --- bin/importmap | 11 +++++++++++ composer.json | 3 +++ 2 files changed, 14 insertions(+) create mode 100755 bin/importmap diff --git a/bin/importmap b/bin/importmap new file mode 100755 index 0000000..e8b1e77 --- /dev/null +++ b/bin/importmap @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +ARGS=(php artisan) + +if [ $# -gt 0 ]; then + ARGS+=("importmap:$@") +else + ARGS+=(list importmap) +fi + +"${ARGS[@]}" diff --git a/composer.json b/composer.json index fe5beea..413894b 100644 --- a/composer.json +++ b/composer.json @@ -31,6 +31,9 @@ "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.5" }, + "bin": [ + "bin/importmap" + ], "autoload": { "psr-4": { "Tonysm\\ImportmapLaravel\\": "src" From 247b7e74854f0871b35b2176e35854c1f4b39131 Mon Sep 17 00:00:00 2001 From: Tony Messias Date: Mon, 30 Oct 2023 23:16:36 -0300 Subject: [PATCH 2/3] Replace importmap: with importmap+space in the output --- bin/importmap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/importmap b/bin/importmap index e8b1e77..adbeb47 100755 --- a/bin/importmap +++ b/bin/importmap @@ -8,4 +8,7 @@ else ARGS+=(list importmap) fi -"${ARGS[@]}" +OUTPUT=$("${ARGS[@]}") +MODIFIED_OUTPUT="${OUTPUT//importmap:/importmap }" + +echo $MODIFIED_OUTPUT From c1f487b9690d14cd54c96ccd57d98bcc1621f4e1 Mon Sep 17 00:00:00 2001 From: Tony Messias Date: Mon, 30 Oct 2023 23:17:44 -0300 Subject: [PATCH 3/3] Fix missing lines --- bin/importmap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/importmap b/bin/importmap index adbeb47..213cab4 100755 --- a/bin/importmap +++ b/bin/importmap @@ -11,4 +11,4 @@ fi OUTPUT=$("${ARGS[@]}") MODIFIED_OUTPUT="${OUTPUT//importmap:/importmap }" -echo $MODIFIED_OUTPUT +echo "${MODIFIED_OUTPUT}"