Repository navigation
Expand file tree
/
Copy pathgit-safe-commit.sh
More file actions
executable file
·89 lines (71 loc) · 1.96 KB
/
Copy pathgit-safe-commit.sh
File metadata and controls
executable file
·89 lines (71 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
# Güvenli commit script - Sadece önemli dosyaları commit eder
echo "🔍 Git durumu kontrol ediliyor..."
echo ""
# Önce durumu göster
echo "📋 Mevcut durum:"
git status --short
echo ""
# Kullanıcıya sor
read -p "Devam etmek istiyor musunuz? (y/n): " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "❌ İptal edildi"
exit 1
fi
echo ""
echo "📦 Önemli dosyalar ekleniyor..."
# Test dosyalarını ekle
echo " ✅ Test dosyaları..."
git add context/__tests__/
git add hooks/__tests__/
git add utils/__tests__/
# Jest konfigürasyonlarını ekle
echo " ✅ Jest konfigürasyonları..."
git add jest.config.js
git add jest.config.simple.js
git add jest.setup.js
# CI/CD workflow'u ekle
echo " ✅ CI/CD workflow..."
git add .github/
# Package dosyalarını ekle
echo " ✅ Package dosyaları..."
git add package.json
git add package-lock.json
# Gitignore'u ekle
echo " ✅ .gitignore..."
git add .gitignore
echo ""
echo "📋 Staged dosyalar:"
git status --short
echo ""
read -p "Commit mesajı girin (boş bırakırsanız varsayılan kullanılır): " commit_msg
if [ -z "$commit_msg" ]; then
commit_msg="test: add test files and jest configuration
- Add unit tests for geoUtils (11 tests)
- Add tests for useDashboardModel hook (8 tests)
- Add tests for ThemeContext (10 tests)
- Add Jest configuration files
- Add CI/CD workflow for automated testing
- Update package.json with test dependencies"
fi
echo ""
echo "💾 Commit ediliyor..."
git commit -m "$commit_msg"
if [ $? -eq 0 ]; then
echo ""
echo "✅ Commit başarılı!"
echo ""
read -p "Push etmek istiyor musunuz? (y/n): " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "🚀 Push ediliyor..."
git push origin master
echo "✅ Push başarılı!"
else
echo "ℹ️ Push edilmedi. İstediğiniz zaman 'git push origin master' ile push edebilirsiniz."
fi
else
echo "❌ Commit başarısız!"
exit 1
fi