@halilertekin/macos-system-cleaner 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ class MacosSystemCleaner < Formula
2
2
  desc "A collection of scripts to clean RAM, cache and IDEs for improved macOS system performance"
3
3
  homepage "https://github.com/halilertekin/macOS-System-Cleaner"
4
4
  url "https://github.com/halilertekin/macOS-System-Cleaner/archive/refs/tags/v1.1.0.tar.gz"
5
- sha256 "REPLACE_WITH_ACTUAL_SHA256" # This will be updated with each new release
5
+ sha256 "31639b94bcbc94ac8942ccdb0c68c3d952dd641f728175cd0e9bef591de028a1" # Updated SHA256 for v1.1.0
6
6
  license "MIT"
7
7
 
8
8
  def install
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halilertekin/macos-system-cleaner",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "A collection of scripts to clean RAM, cache and IDEs for improved macOS system performance",
5
5
  "main": "main_cleaner.sh",
6
6
  "scripts": {
@@ -36,5 +36,10 @@
36
36
  "url": "https://github.com/halilertekin/macOS-System-Cleaner/issues"
37
37
  },
38
38
  "homepage": "https://github.com/halilertekin/macOS-System-Cleaner#readme",
39
- "preferGlobal": true
39
+ "preferGlobal": true,
40
+ "files": [
41
+ "main_cleaner.sh",
42
+ "scripts/",
43
+ "macos-system-cleaner.rb"
44
+ ]
40
45
  }
package/install.sh DELETED
@@ -1,155 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # macOS System Cleaner Kurulum Scripti
4
-
5
- set -e # Hatalarda çık
6
-
7
- # Renkler
8
- RED='\033[0;31m'
9
- GREEN='\033[0;32m'
10
- YELLOW='\033[1;33m'
11
- BLUE='\033[0;34m'
12
- NC='\033[0m' # Renksiz
13
-
14
- # Renkli çıktı fonksiyonları
15
- print_status() {
16
- echo -e "${BLUE}[BİLGİ]${NC} $1"
17
- }
18
-
19
- print_success() {
20
- echo -e "${GREEN}[BAŞARILI]${NC} $1"
21
- }
22
-
23
- print_warning() {
24
- echo -e "${YELLOW}[UYARI]${NC} $1"
25
- }
26
-
27
- print_error() {
28
- echo -e "${RED}[HATA]${NC} $1"
29
- }
30
-
31
- # Yardım menüsü
32
- show_help() {
33
- echo "macOS System Cleaner Kurulum Scripti"
34
- echo "Script'leri kurar ve gerekli ayarlamaları yapar"
35
- echo
36
- echo "Kullanım: $0 [seçenek]"
37
- echo
38
- echo "Seçenekler:"
39
- echo " --bash-alias Bash alias kurulumu yapar"
40
- echo " --zsh-alias Zsh alias kurulumu yapar"
41
- echo " --npm-install npm ile global kurulum yapar (npm gerekli)"
42
- echo " --help Bu yardım menüsünü gösterir"
43
- echo
44
- echo "Not: Script'ler zaten çalıştırma iznine sahip olarak gelmektedir."
45
- }
46
-
47
- # Bash alias kurulumu
48
- install_bash_alias() {
49
- print_status "Bash alias kurulumu yapılıyor..."
50
-
51
- # Bashrc dosyasını kontrol et
52
- BASHRC_FILE="$HOME/.bashrc"
53
- if [ ! -f "$BASHRC_FILE" ]; then
54
- BASHRC_FILE="$HOME/.bash_profile"
55
- if [ ! -f "$BASHRC_FILE" ]; then
56
- print_error "Ne .bashrc ne de .bash_profile dosyası bulunamadı."
57
- return 1
58
- fi
59
- fi
60
-
61
- # Alias zaten var mı kontrol et
62
- if grep -q "alias msc=" "$BASHRC_FILE"; then
63
- print_warning "msc alias zaten mevcut, güncelleniyor..."
64
- sed -i.bak '/alias msc=/d' "$BASHRC_FILE"
65
- fi
66
-
67
- # Script dizinini bul
68
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
69
-
70
- # Yeni alias ekle
71
- echo "alias msc='$SCRIPT_DIR/main_cleaner.sh'" >> "$BASHRC_FILE"
72
-
73
- # Ek kısayollar
74
- echo "alias msc-analyze='$SCRIPT_DIR/main_cleaner.sh analyze'" >> "$BASHRC_FILE"
75
- echo "alias msc-cache='$SCRIPT_DIR/scripts/cache_cleaner.sh clean'" >> "$BASHRC_FILE"
76
- echo "alias msc-ram='$SCRIPT_DIR/scripts/ram_cleaner.sh clear'" >> "$BASHRC_FILE"
77
- echo "alias msc-ide='$SCRIPT_DIR/scripts/ide_cleaner.sh all'" >> "$BASHRC_FILE"
78
-
79
- print_success "Bash alias'ları kuruldu. Yeni terminal oturumunda aktif olacak."
80
- print_status "Eğer hemen kullanmak istiyorsanız: source $BASHRC_FILE"
81
- }
82
-
83
- # Zsh alias kurulumu
84
- install_zsh_alias() {
85
- print_status "Zsh alias kurulumu yapılıyor..."
86
-
87
- # Zshrc dosyasını kontrol et
88
- ZSHRC_FILE="$HOME/.zshrc"
89
- if [ ! -f "$ZSHRC_FILE" ]; then
90
- print_error ".zshrc dosyası bulunamadı."
91
- return 1
92
- fi
93
-
94
- # Alias zaten var mı kontrol et
95
- if grep -q "alias msc=" "$ZSHRC_FILE"; then
96
- print_warning "msc alias zaten mevcut, güncelleniyor..."
97
- sed -i.bak '/alias msc=/d' "$ZSHRC_FILE"
98
- fi
99
-
100
- # Script dizinini bul
101
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
102
-
103
- # Yeni alias ekle
104
- echo "alias msc='$SCRIPT_DIR/main_cleaner.sh'" >> "$ZSHRC_FILE"
105
-
106
- # Ek kısayollar
107
- echo "alias msc-analyze='$SCRIPT_DIR/main_cleaner.sh analyze'" >> "$ZSHRC_FILE"
108
- echo "alias msc-cache='$SCRIPT_DIR/scripts/cache_cleaner.sh clean'" >> "$ZSHRC_FILE"
109
- echo "alias msc-ram='$SCRIPT_DIR/scripts/ram_cleaner.sh clear'" >> "$ZSHRC_FILE"
110
- echo "alias msc-ide='$SCRIPT_DIR/scripts/ide_cleaner.sh all'" >> "$ZSHRC_FILE"
111
-
112
- print_success "Zsh alias'ları kuruldu. Yeni terminal oturumunda aktif olacak."
113
- print_status "Eğer hemen kullanmak istiyorsanız: source $ZSHRC_FILE"
114
- }
115
-
116
- # Npm kurulumu
117
- install_npm() {
118
- print_status "npm ile global kurulum yapılıyor..."
119
-
120
- # npm yüklü mü kontrol et
121
- if ! command -v npm &> /dev/null; then
122
- print_error "npm bulunamadı. npm yüklü olduğundan emin olun."
123
- return 1
124
- fi
125
-
126
- # Proje dizinine git
127
- PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
128
- cd "$PROJECT_DIR"
129
-
130
- # npm paketini global olarak yükle
131
- npm install -g .
132
-
133
- print_success "npm ile global kurulum tamamlandı. Artık 'msc' komutunu doğrudan kullanabilirsiniz."
134
- }
135
-
136
- # Ana fonksiyon
137
- main() {
138
- case "${1:-help}" in
139
- "--bash-alias")
140
- install_bash_alias
141
- ;;
142
- "--zsh-alias")
143
- install_zsh_alias
144
- ;;
145
- "--npm-install")
146
- install_npm
147
- ;;
148
- "--help"|"-h"|*)
149
- show_help
150
- ;;
151
- esac
152
- }
153
-
154
- # Ana fonksiyonu çalıştır
155
- main "$@"
@@ -1,50 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- # Configuration
5
- SOURCE_FORMULA="/Users/halil/macOS-System-Cleaner/macos-system-cleaner.rb"
6
- TAP_DIR="/Users/halil/homebrew-tap"
7
- TARGET_FORMULA="$TAP_DIR/Formula/macos-system-cleaner.rb"
8
-
9
- # Colors
10
- GREEN='\033[0;32m'
11
- BLUE='\033[0;34m'
12
- RED='\033[0;31m'
13
- NC='\033[0m'
14
-
15
- echo -e "${BLUE}[INFO]${NC} Starting publication process..."
16
-
17
- # Check if Tap directory exists
18
- if [ ! -d "$TAP_DIR" ]; then
19
- echo -e "${RED}[ERROR]${NC} Tap directory not found at $TAP_DIR"
20
- exit 1
21
- fi
22
-
23
- # Copy formula
24
- echo -e "${BLUE}[INFO]${NC} Copying formula to Tap..."
25
- cp "$SOURCE_FORMULA" "$TARGET_FORMULA"
26
- echo -e "${GREEN}[SUCCESS]${NC} Formula copied."
27
-
28
- # Git operations
29
- cd "$TAP_DIR"
30
- echo -e "${BLUE}[INFO]${NC} Committing changes in $TAP_DIR..."
31
-
32
- # Check if there are changes
33
- if git diff --quiet && git diff --staged --quiet && [ -f "$TARGET_FORMULA" ]; then
34
- # Check if file is untracked
35
- if [ -z "$(git status --porcelain)" ]; then
36
- echo -e "${BLUE}[INFO]${NC} No changes to commit."
37
- exit 0
38
- fi
39
- fi
40
-
41
- git add Formula/macos-system-cleaner.rb
42
- git commit -m "feat: update macos-system-cleaner to v1.1.0" || echo -e "${BLUE}[INFO]${NC} Nothing to commit or commit failed."
43
-
44
- echo -e "${BLUE}[INFO]${NC} Pushing to remote..."
45
- git push origin HEAD
46
-
47
- echo -e "${GREEN}[SUCCESS]${NC} Successfully published macos-system-cleaner v1.1.0 to your Tap!"
48
- echo -e "${BLUE}[INFO]${NC} You can now install it using:"
49
- echo " brew tap halilertekin/tap"
50
- echo " brew install macos-system-cleaner"
package/release.sh DELETED
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env bash
2
- # -------------------------------------------------
3
- # Automated release script for macOS-System-Cleaner
4
- # - Git commit & push
5
- # - npm version bump (patch)
6
- # - npm publish (public)
7
- # - Homebrew formula publish (via publish_release.sh)
8
- # -------------------------------------------------
9
-
10
- set -e
11
-
12
- # ---------- Configuration ----------
13
- PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
- NPM_DIR="$PROJECT_ROOT"
15
- HOMEBREW_SCRIPT="$PROJECT_ROOT/publish_release.sh"
16
- GIT_REMOTE="origin"
17
- GIT_BRANCH="main"
18
-
19
- # ---------- Git commit (if any) ----------
20
- cd "$PROJECT_ROOT"
21
- if [[ -n "$(git status --porcelain)" ]]; then
22
- echo -e "\e[34m[INFO]\e[0m Staging all changes..."
23
- git add -A
24
- echo -e "\e[34m[INFO]\e[0m Creating commit..."
25
- git commit -m "chore: prepare release"
26
- else
27
- echo -e "\e[34m[INFO]\e[0m No local changes to commit."
28
- fi
29
-
30
- # ---------- npm version bump ----------
31
- cd "$NPM_DIR"
32
- echo -e "\e[34m[INFO]\e[0m Bumping npm version (patch)..."
33
- npm version patch -m "chore: release v%s"
34
-
35
- # ---------- npm publish ----------
36
- echo -e "\e[34m[INFO]\e[0m Publishing to npm (public)..."
37
- npm publish --access public
38
-
39
- # ---------- Git tag & push ----------
40
- NEW_TAG=$(git describe --tags --abbrev=0)
41
- echo -e "\e[34m[INFO]\e[0m Pushing commit and tag ${NEW_TAG} to ${GIT_REMOTE}/${GIT_BRANCH}..."
42
- git push "$GIT_REMOTE" "$GIT_BRANCH"
43
- git push "$GIT_REMOTE" "$NEW_TAG"
44
-
45
- # ---------- Homebrew publish ----------
46
- if [[ -x "$HOMEBREW_SCRIPT" ]]; then
47
- echo -e "\e[34m[INFO]\e[0m Running Homebrew publish script..."
48
- "$HOMEBREW_SCRIPT"
49
- else
50
- echo -e "\e[31m[ERROR]\e[0m publish_release.sh not found or not executable."
51
- exit 1
52
- fi
53
-
54
- echo -e "\e[32m[SUCCESS]\e[0m Release process completed!"
@@ -1,265 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # Homebrew Formula SHA256 Otomatik Güncelleme Scripti
4
- # GitHub'da yeni bir tag oluşturulduğunda, ilgili tarball'ın SHA256 hash'ini hesaplar
5
- # ve Homebrew formula dosyasını otomatik olarak günceller
6
-
7
- set -e # Hatalarda çık
8
-
9
- # Renkler
10
- RED='\033[0;31m'
11
- GREEN='\033[0;32m'
12
- YELLOW='\033[1;33m'
13
- BLUE='\033[0;34m'
14
- NC='\033[0m' # Renksiz
15
-
16
- # Renkli çıktı fonksiyonları
17
- print_status() {
18
- echo -e "${BLUE}[INFO]${NC} $1" >&2
19
- }
20
-
21
- print_success() {
22
- echo -e "${GREEN}[SUCCESS]${NC} $1" >&2
23
- }
24
-
25
- print_warning() {
26
- echo -e "${YELLOW}[WARNING]${NC} $1" >&2
27
- }
28
-
29
- print_error() {
30
- echo -e "${RED}[ERROR]${NC} $1" >&2
31
- }
32
-
33
- # Yardım menüsü
34
- show_help() {
35
- echo "Homebrew Formula SHA256 Otomatik Güncelleme Scripti"
36
- echo "GitHub'da yeni tag'e göre SHA256 hash hesaplar ve formula dosyasını günceller"
37
- echo
38
- echo "Kullanım: $0 [seçenek] [tag]"
39
- echo
40
- echo "Seçenekler:"
41
- echo " --update <tag> Belirtilen tag için SHA256 hash hesapla ve güncelle"
42
- echo " --dry-run <tag> Sadece hesapla, güncelleme yapma (test modu)"
43
- echo " --latest GitHub'dan son tag'ı al ve güncelle"
44
- echo " --show-current Mevcut formula versiyonunu göster"
45
- echo " --help Bu yardım menüsünü gösterir"
46
- echo
47
- echo "Örnekler:"
48
- echo " $0 --update v1.1.0"
49
- echo " $0 --latest"
50
- echo " $0 --dry-run v1.1.0"
51
- echo " $0 --show-current"
52
- }
53
-
54
- # SHA256 hash hesapla
55
- calculate_sha256() {
56
- local tag=$1
57
- local repo_url="https://github.com/halilertekin/macOS-System-Cleaner/archive/refs/tags/${tag}.tar.gz"
58
-
59
- print_status "Tarball indiriliyor: $repo_url"
60
-
61
- # Geçici dosya oluştur
62
- local temp_tarball=$(mktemp)
63
-
64
- # Tarball'ı indir
65
- if ! curl -L -o "$temp_tarball" "$repo_url"; then
66
- print_error "Tarball indirilemedi: $repo_url"
67
- rm -f "$temp_tarball"
68
- return 1
69
- fi
70
-
71
- # SHA256 hash hesapla
72
- local sha256_hash=$(shasum -a 256 "$temp_tarball" | cut -d ' ' -f 1)
73
-
74
- # Geçici dosyayı sil
75
- rm -f "$temp_tarball"
76
-
77
- echo "$sha256_hash"
78
- }
79
-
80
- # GitHub'dan son tag'ı al
81
- get_latest_tag() {
82
- print_status "GitHub'dan son tag alınıyor..."
83
-
84
- # GitHub API kullanarak son tag'ı al
85
- local latest_tag=$(curl -s "https://api.github.com/repos/halilertekin/macOS-System-Cleaner/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
86
-
87
- if [ -z "$latest_tag" ]; then
88
- print_warning "GitHub API'den tag alınamadı, yerel repodan tag aranıyor..."
89
- # Yerel repoda tag varsa onu kullan
90
- if git rev-parse --verify --quiet "$(git tag --list | tail -n 1)" >/dev/null 2>&1; then
91
- latest_tag=$(git tag --list | tail -n 1)
92
- fi
93
- fi
94
-
95
- echo "$latest_tag"
96
- }
97
-
98
- # Tag formatını kontrol et
99
- validate_tag() {
100
- local tag=$1
101
-
102
- if [[ ! "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
103
- print_warning "Tag formatı önerilen formatta değil (örn: v1.2.3): $tag"
104
- read -p "Yine de kullanmak istiyor musunuz? (e/H): " -n 1 -r
105
- echo
106
- if [[ ! $REPLY =~ ^[Ee]$ ]]; then
107
- print_error "İşlem iptal edildi."
108
- return 1
109
- fi
110
- fi
111
- }
112
-
113
- # Formula dosyasını yedekle
114
- backup_formula() {
115
- local formula_file="macos-system-cleaner.rb"
116
- local backup_file="${formula_file}.backup.$(date +%Y%m%d_%H%M%S)"
117
-
118
- if [ -f "$formula_file" ]; then
119
- cp "$formula_file" "$backup_file"
120
- print_status "Formula dosyası yedeklendi: $backup_file"
121
- else
122
- print_error "Formula dosyası bulunamadı: $formula_file"
123
- return 1
124
- fi
125
- }
126
-
127
- # Formula dosyasını güncelle
128
- update_formula() {
129
- local tag=$1
130
- local new_sha256=$2
131
- local formula_file="macos-system-cleaner.rb"
132
-
133
- if [ ! -f "$formula_file" ]; then
134
- print_error "Formula dosyası bulunamadı: $formula_file"
135
- return 1
136
- fi
137
-
138
- print_status "Formula dosyası güncelleniyor: $formula_file"
139
- print_status "Yeni tag: $tag"
140
- print_status "Yeni SHA256: $new_sha256"
141
-
142
- # Formula dosyasını yedekle
143
- backup_formula
144
-
145
- # Eski tag ve SHA256 değerlerini bul ve değiştir
146
- # URL satırını güncelle
147
- sed -i.bak "s|https://github.com/halilertekin/macOS-System-Cleaner/archive/refs/tags/v[0-9.]*\.tar\.gz|https://github.com/halilertekin/macOS-System-Cleaner/archive/refs/tags/${tag}.tar.gz|g" "$formula_file"
148
-
149
- # SHA256 satırını güncelle
150
- sed -i.bak "s|sha256 \"[a-f0-9]*\"|sha256 \"${new_sha256}\"|g" "$formula_file"
151
-
152
- # Versiyon bilgisini de güncelle (eğer varsa)
153
- sed -i.bak "s|version \"v[0-9.]*\"|version \"${tag}\"|g" "$formula_file" 2>/dev/null || true
154
-
155
- # Yedek dosyayı sil
156
- rm -f "$formula_file.bak"
157
-
158
- print_success "Formula dosyası başarıyla güncellendi!"
159
- }
160
-
161
- # Mevcut versiyonu göster
162
- show_current_version() {
163
- local formula_file="macos-system-cleaner.rb"
164
-
165
- if [ -f "$formula_file" ]; then
166
- local current_version=$(grep -o 'url "https://github.com/halilertekin/macOS-System-Cleaner/archive/refs/tags/[^"]*"' "$formula_file" | grep -o 'v[0-9.]*' | head -1)
167
- local current_sha256=$(grep -o 'sha256 "[^"]*"' "$formula_file" | cut -d '"' -f 2)
168
-
169
- echo "Mevcut versiyon: ${current_version:-Bilinmiyor}"
170
- echo "Mevcut SHA256: ${current_sha256:-Bilinmiyor}"
171
- else
172
- echo "Formula dosyası bulunamadı"
173
- fi
174
- }
175
-
176
- # Ana fonksiyon
177
- main() {
178
- case "${1:-help}" in
179
- "--update")
180
- if [ -z "$2" ]; then
181
- print_error "Lütfen bir tag belirtin: $0 --update <tag>"
182
- exit 1
183
- fi
184
-
185
- local tag="$2"
186
- validate_tag "$tag"
187
- if [ $? -ne 0 ]; then
188
- exit 1
189
- fi
190
-
191
- print_status "SHA256 hash hesaplanıyor: $tag"
192
-
193
- local sha256_hash=$(calculate_sha256 "$tag")
194
- if [ $? -ne 0 ]; then
195
- print_error "SHA256 hash hesaplanamadı"
196
- exit 1
197
- fi
198
-
199
- print_status "Hesaplanan SHA256: $sha256_hash"
200
-
201
- update_formula "$tag" "$sha256_hash"
202
- ;;
203
- "--dry-run")
204
- if [ -z "$2" ]; then
205
- print_error "Lütfen bir tag belirtin: $0 --dry-run <tag>"
206
- exit 1
207
- fi
208
-
209
- local tag="$2"
210
- validate_tag "$tag"
211
- if [ $? -ne 0 ]; then
212
- exit 1
213
- fi
214
-
215
- print_status "SHA256 hash hesaplanıyor (test modu): $tag"
216
-
217
- local sha256_hash=$(calculate_sha256 "$tag")
218
- if [ $? -ne 0 ]; then
219
- print_error "SHA256 hash hesaplanamadı"
220
- exit 1
221
- fi
222
-
223
- print_status "Hesaplanan SHA256: $sha256_hash"
224
- print_warning "Bu sadece test modudur. Formula dosyası güncellenmedi."
225
- ;;
226
- "--latest")
227
- print_status "GitHub'dan son tag alınıyor..."
228
- local latest_tag=$(get_latest_tag)
229
- if [ -z "$latest_tag" ]; then
230
- print_error "GitHub'dan tag alınamadı"
231
- exit 1
232
- fi
233
-
234
- print_status "Bulunan son tag: $latest_tag"
235
- validate_tag "$latest_tag"
236
- if [ $? -ne 0 ]; then
237
- exit 1
238
- fi
239
-
240
- print_status "SHA256 hash hesaplanıyor: $latest_tag"
241
-
242
- local sha256_hash=$(calculate_sha256 "$latest_tag")
243
- if [ $? -ne 0 ]; then
244
- print_error "SHA256 hash hesaplanamadı"
245
- exit 1
246
- fi
247
-
248
- print_status "Hesaplanan SHA256: $sha256_hash"
249
-
250
- update_formula "$latest_tag" "$sha256_hash"
251
- ;;
252
- "--show-current")
253
- print_status "Mevcut formula versiyonu:"
254
- show_current_version
255
- ;;
256
- "--help"|"-h"|*)
257
- show_help
258
- ;;
259
- esac
260
- }
261
-
262
- # Ana fonksiyonu çalıştır
263
- main "$@"
264
-
265
- # Script sonu