Bye bye submodules (#6585)
* WIP * Uses ssh instead * Update .gitignore * Update .gitignore * Update Makefile * Update git-setup.sh * Update git-setup.sh * Replaced Makefile with bash script * Update package.jsonpull/6603/head
parent
7b5482e83d
commit
8d078564dd
|
@ -80,3 +80,9 @@ apps/storybook/build-storybook.log
|
||||||
# Snaplet
|
# Snaplet
|
||||||
.snaplet/snapshots
|
.snaplet/snapshots
|
||||||
.snaplet/structure.d.ts
|
.snaplet/structure.d.ts
|
||||||
|
|
||||||
|
# Submodules
|
||||||
|
.gitmodules
|
||||||
|
apps/api
|
||||||
|
apps/website
|
||||||
|
apps/console
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
[submodule "apps/console"]
|
|
||||||
path = apps/console
|
|
||||||
url = https://github.com/calcom/console.git
|
|
||||||
branch = main
|
|
||||||
[submodule "apps/api"]
|
|
||||||
path = apps/api
|
|
||||||
url = https://github.com/calcom/api.git
|
|
||||||
branch = main
|
|
||||||
[submodule "apps/website"]
|
|
||||||
path = apps/website
|
|
||||||
url = https://github.com/calcom/website.git
|
|
||||||
branch = main
|
|
1
apps/api
1
apps/api
|
@ -1 +0,0 @@
|
||||||
Subproject commit 7aebdb8c966f472383cf55e8da31e9655102e775
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 9aac72159ef357db240ef6d4d897f7322c843b6a
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 8f5d66f2cc4a7ed4f8c05d37dbf0417df5a57cd9
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# If there's a `.gitmodule` file skip this script
|
||||||
|
[ -f .gitmodules ] && {
|
||||||
|
echo ".gitmodules already initializied"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
./git-setup.sh api website console
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# If no project name is given
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
# Display usage and stop
|
||||||
|
echo "Usage: git-setup.sh <api,console,website>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Loop through the requested modules
|
||||||
|
for module in "$@"; do
|
||||||
|
echo "Setting up '$module' module..."
|
||||||
|
# Set the project git URL
|
||||||
|
project=$(echo "git@github.com:calcom/$module.git")
|
||||||
|
# Check if we have access to the module
|
||||||
|
if [ "$(git ls-remote "$project" 2>/dev/null)" ]; then
|
||||||
|
echo "You have access to '${module}'"
|
||||||
|
# Create the .gitmodules file if it doesn't exist
|
||||||
|
([ -e ".gitmodules" ] || touch ".gitmodules") && [ ! -w ".gitmodules" ] && echo cannot write to .gitmodules && exit 1
|
||||||
|
# Prevents duplicate entries
|
||||||
|
git config -f .gitmodules --unset-all "submodule.apps/$module.branch"
|
||||||
|
# Add the submodule
|
||||||
|
git submodule add --force "git@github.com:calcom/$module.git" "apps/$module"
|
||||||
|
# Set the default branch to main
|
||||||
|
git config -f .gitmodules --add "submodule.apps/$module.branch" main
|
||||||
|
# Adding the subdmoule ignores the `.gitignore` so a reset is needed
|
||||||
|
git reset
|
||||||
|
else
|
||||||
|
# If the module is the API, display a link to request access
|
||||||
|
if [ "$module" == "api" ]; then
|
||||||
|
echo "You don't have access to: '${module}' module. You can request access in: https://console.cal.com"
|
||||||
|
else
|
||||||
|
# If the module is not the API, display normal message
|
||||||
|
echo "You don't have access to: '${module}' module."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
|
@ -50,6 +50,7 @@
|
||||||
"lint": "turbo run lint",
|
"lint": "turbo run lint",
|
||||||
"postinstall": "turbo run post-install",
|
"postinstall": "turbo run post-install",
|
||||||
"pre-commit": "lint-staged",
|
"pre-commit": "lint-staged",
|
||||||
|
"preinstall": "./git-init.sh",
|
||||||
"predev": "echo 'Checking env files'",
|
"predev": "echo 'Checking env files'",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"prisma": "yarn workspace @calcom/prisma prisma",
|
"prisma": "yarn workspace @calcom/prisma prisma",
|
||||||
|
|
Loading…
Reference in New Issue