From 719cbec897214060114bff349d6dc93386a95193 Mon Sep 17 00:00:00 2001 From: Winfried Kappeler Date: Tue, 20 Feb 2024 09:58:24 +0100 Subject: [PATCH] Usage of git repository (composer.json) --- SwitchRepo | 17 +++++++++++++++++ composer.json | 7 ++----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100755 SwitchRepo diff --git a/SwitchRepo b/SwitchRepo new file mode 100755 index 0000000..9cb8cfb --- /dev/null +++ b/SwitchRepo @@ -0,0 +1,17 @@ +#! /bin/bash +MODE=$1 +if [ "$MODE" != 'git' -a "$MODE" != 'local' ]; then + echo "+++ unknown MODE, expecting 'git' or 'local'" + echo "Example: SwitchRepo git" +fi +function Switch(){ + composer config --unset repositories.vendor/laraknife + grep -i "repository" composer.json + if [ "$MODE" = git ]; then + composer config repositories.laraknife vcs https://github.com/hamatoma/laraknife + else + composer config repositories.laraknife '{"type": "path", "url": "../laraknife", "options": {"symlink": true}}' + fi +} +Switch + diff --git a/composer.json b/composer.json index 73c205f..f8f3907 100644 --- a/composer.json +++ b/composer.json @@ -68,11 +68,8 @@ "prefer-stable": true, "repositories": { "laraknife": { - "type": "path", - "url": "../laraknife", - "options": { - "symlink": true - } + "type": "vcs", + "url": "https://github.com/hamatoma/laraknife" } } } -- 2.39.5