You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-06 04:52:56 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d338eb831 | |||
| c06624768d | |||
| 8106db5ed6 |
@@ -10,6 +10,34 @@ NC='\033[0m' # No Color
|
||||
CHECK_MARK="✅"
|
||||
CROSS_MARK="❌"
|
||||
|
||||
# Initialize global flags
|
||||
DEBUG=0
|
||||
DRY_RUN=0
|
||||
|
||||
# Process command-line arguments
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--debug)
|
||||
DEBUG=1
|
||||
shift
|
||||
;;
|
||||
--dry-run)
|
||||
DRY_RUN=1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# Unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Debug message function
|
||||
debug_msg() {
|
||||
if [ "$DEBUG" -eq 1 ]; then
|
||||
echo -e "${INDIGO}Debug: $*${NC}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Define remotes
|
||||
REMOTES=(
|
||||
'src/Prime:flasher'
|
||||
@@ -45,27 +73,44 @@ REMOTES=(
|
||||
'packs/symfony-pack:symfony-pack'
|
||||
)
|
||||
|
||||
# Function to get the current git branch name
|
||||
function current_branch() {
|
||||
git rev-parse --abbrev-ref HEAD
|
||||
}
|
||||
|
||||
# Define a function to split and push code to a remote repository
|
||||
function split() {
|
||||
local prefix_and_remote="$1"
|
||||
local prefix="${prefix_and_remote%:*}"
|
||||
local remote="${prefix_and_remote#*:}"
|
||||
local current_branch=$(current_branch)
|
||||
|
||||
# Add remote if it does not exist (ignoring errors silently)
|
||||
if git remote add "$remote" "git@github.com:php-flasher/$remote.git" 2>/dev/null; then
|
||||
echo -e "${GREEN}Added remote ${INDIGO}$remote${NC} ${CHECK_MARK}"
|
||||
else
|
||||
debug_msg "Remote $remote already exists or could not be added."
|
||||
fi
|
||||
|
||||
# Split the code using the splitsh-lite utility
|
||||
SHA1=$(./bin/splitsh-lite --prefix="$prefix")
|
||||
debug_msg "SHA1 for $prefix is $SHA1."
|
||||
|
||||
# Push the code to the specified remote repository
|
||||
git push "$remote" "$SHA1:refs/heads/main" -f
|
||||
# Push the code to the remote repository on the same branch as the current branch
|
||||
if [ "$DRY_RUN" -eq 0 ]; then
|
||||
git push "$remote" "$SHA1:refs/heads/$current_branch" -f
|
||||
else
|
||||
echo -e "${INDIGO}Dry run: Would push $SHA1 to $remote on branch $current_branch${NC}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Pull the latest code from the origin repository
|
||||
echo -e "${INDIGO}Pulling the latest code from the origin repository...${NC}"
|
||||
git fetch origin main
|
||||
if [ "$DRY_RUN" -eq 0 ]; then
|
||||
echo -e "${INDIGO}Pulling the latest code from the origin repository on branch ${current_branch}...${NC}"
|
||||
git fetch origin "$current_branch"
|
||||
else
|
||||
echo -e "${INDIGO}Dry run: Would fetch latest code for branch $current_branch from the origin repository.${NC}"
|
||||
fi
|
||||
|
||||
# Iterate over the remotes and split and push the code
|
||||
for remote in "${REMOTES[@]}"; do
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-cli": "^1.15.13",
|
||||
"php-flasher/flasher-laravel": "^1.15.13"
|
||||
"php-flasher/flasher-cli": "^1.15.14",
|
||||
"php-flasher/flasher-laravel": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"ext-mbstring": "*",
|
||||
"php-flasher/flasher": "^1.15.13"
|
||||
"php-flasher/flasher": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-cli": "^1.15.13",
|
||||
"php-flasher/flasher-symfony": "^1.15.13"
|
||||
"php-flasher/flasher-cli": "^1.15.14",
|
||||
"php-flasher/flasher-symfony": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Flasher\Laravel\Command;
|
||||
|
||||
use Flasher\Laravel\Support\ServiceProvider as FlasherServiceProvider;
|
||||
use Flasher\Prime\Plugin\PluginInterface;
|
||||
use Flasher\Symfony\Bridge\Command\FlasherCommand;
|
||||
use Flasher\Laravel\Bridge\Command\FlasherCommand;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"illuminate/support": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
|
||||
"php-flasher/flasher": "^1.15.13"
|
||||
"php-flasher/flasher": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-laravel": "^1.15.13",
|
||||
"php-flasher/flasher-noty": "^1.15.13"
|
||||
"php-flasher/flasher-laravel": "^1.15.14",
|
||||
"php-flasher/flasher-noty": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher": "^1.15.13"
|
||||
"php-flasher/flasher": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-noty": "^1.15.13",
|
||||
"php-flasher/flasher-symfony": "^1.15.13"
|
||||
"php-flasher/flasher-noty": "^1.15.14",
|
||||
"php-flasher/flasher-symfony": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-laravel": "^1.15.13",
|
||||
"php-flasher/flasher-notyf": "^1.15.13"
|
||||
"php-flasher/flasher-laravel": "^1.15.14",
|
||||
"php-flasher/flasher-notyf": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher": "^1.15.13"
|
||||
"php-flasher/flasher": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-notyf": "^1.15.13",
|
||||
"php-flasher/flasher-symfony": "^1.15.13"
|
||||
"php-flasher/flasher-notyf": "^1.15.14",
|
||||
"php-flasher/flasher-symfony": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-laravel": "^1.15.13",
|
||||
"php-flasher/flasher-pnotify": "^1.15.13"
|
||||
"php-flasher/flasher-laravel": "^1.15.14",
|
||||
"php-flasher/flasher-pnotify": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher": "^1.15.13"
|
||||
"php-flasher/flasher": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-pnotify": "^1.15.13",
|
||||
"php-flasher/flasher-symfony": "^1.15.13"
|
||||
"php-flasher/flasher-pnotify": "^1.15.14",
|
||||
"php-flasher/flasher-symfony": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-laravel": "^1.15.13",
|
||||
"php-flasher/flasher-sweetalert": "^1.15.13"
|
||||
"php-flasher/flasher-laravel": "^1.15.14",
|
||||
"php-flasher/flasher-sweetalert": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher": "^1.15.13"
|
||||
"php-flasher/flasher": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-sweetalert": "^1.15.13",
|
||||
"php-flasher/flasher-symfony": "^1.15.13"
|
||||
"php-flasher/flasher-sweetalert": "^1.15.14",
|
||||
"php-flasher/flasher-symfony": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher": "^1.15.13",
|
||||
"php-flasher/flasher": "^1.15.14",
|
||||
"symfony/config": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
"symfony/console": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
"symfony/dependency-injection": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-laravel": "^1.15.13",
|
||||
"php-flasher/flasher-toastr": "^1.15.13"
|
||||
"php-flasher/flasher-laravel": "^1.15.14",
|
||||
"php-flasher/flasher-toastr": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher": "^1.15.13"
|
||||
"php-flasher/flasher": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-symfony": "^1.15.13",
|
||||
"php-flasher/flasher-toastr": "^1.15.13"
|
||||
"php-flasher/flasher-symfony": "^1.15.14",
|
||||
"php-flasher/flasher-toastr": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
|
||||
Reference in New Issue
Block a user