@deathnaitsa/wa-api 2.0.5 → 2.0.6

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.
package/publish.sh DELETED
@@ -1,103 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Ins Skript-Verzeichnis wechseln (funktioniert mit WSL-Pfaden)
4
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
- cd "$SCRIPT_DIR" || {
6
- echo "Failed to change to script directory"
7
- exit 1
8
- }
9
-
10
- echo "Working directory: $(pwd)"
11
-
12
- # Farben für die Ausgabe
13
- GREEN='\033[0;32m'
14
- RED='\033[0;31m'
15
- YELLOW='\033[1;33m'
16
- BLUE='\033[0;34m'
17
- CYAN='\033[0;36m'
18
- RESET='\033[0m'
19
-
20
- echo ""
21
- echo -e "${CYAN}╔═══════════════════════════════════════════════════════════════╗${RESET}"
22
- echo -e "${CYAN}║ 🚀 WhatsApp API Auto Deploy Script 🚀 ║${RESET}"
23
- echo -e "${CYAN}╚═══════════════════════════════════════════════════════════════╝${RESET}"
24
- echo ""
25
-
26
- # Fehlerbehandlung aktivieren
27
- set -e
28
-
29
- # Trap für saubere Fehlerausgabe
30
- trap 'echo -e "\n${RED}❌ Script failed at line $LINENO${RESET}"; exit 1' ERR
31
-
32
- # Schritt 1: NPM Build
33
- echo -e "${BLUE}[1/5] 📦 Building project...${RESET}"
34
- npm run build
35
- echo -e "${GREEN}✅ Build successful!${RESET}"
36
- echo ""
37
-
38
- # Schritt 2: Git Status prüfen
39
- echo -e "${BLUE}[2/5] 📋 Checking Git status...${RESET}"
40
- git status --short
41
- echo ""
42
-
43
- # Schritt 3: Commit Message eingeben
44
- read -p "$(echo -e ${YELLOW}💬 Enter commit message \(or press Enter for default\): ${RESET})" commit_msg
45
- if [ -z "$commit_msg" ]; then
46
- commit_msg="Update wa-api with new features"
47
- fi
48
- echo ""
49
-
50
- # Schritt 4: Git Add, Commit, Push
51
- echo -e "${BLUE}[3/5] 📤 Committing and pushing to Git...${RESET}"
52
- git add .
53
-
54
- if git commit -m "$commit_msg"; then
55
- echo -e "${GREEN}✅ Committed successfully!${RESET}"
56
- else
57
- echo -e "${YELLOW}⚠️ Nothing to commit or commit failed${RESET}"
58
- fi
59
-
60
- if git push; then
61
- echo -e "${GREEN}✅ Pushed to Git successfully!${RESET}"
62
- elif git push --set-upstream origin main; then
63
- echo -e "${GREEN}✅ Pushed to Git successfully! (upstream set)${RESET}"
64
- else
65
- echo -e "${RED}❌ Git push failed!${RESET}"
66
- exit 1
67
- fi
68
- echo ""
69
-
70
- # Schritt 5: NPM Publish (optional)
71
- echo -e "${BLUE}[4/5] 📢 NPM Publish${RESET}"
72
- read -p "$(echo -e ${YELLOW}Do you want to publish to NPM? \(y/N\): ${RESET})" do_publish
73
- if [[ "$do_publish" =~ ^[Yy]$ ]]; then
74
- echo -e "${BLUE}Publishing to NPM...${RESET}"
75
- if npm publish --access public; then
76
- echo -e "${GREEN}✅ Published to NPM successfully!${RESET}"
77
- published=true
78
- else
79
- echo -e "${RED}❌ NPM publish failed!${RESET}"
80
- echo -e "${YELLOW}💡 Tip: Make sure you're logged in with 'npm login'${RESET}"
81
- exit 1
82
- fi
83
- else
84
- echo -e "${YELLOW}⏭️ Skipping NPM publish${RESET}"
85
- published=false
86
- fi
87
- echo ""
88
-
89
- # Fertig
90
- echo ""
91
- echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════╗${RESET}"
92
- echo -e "${GREEN}║ ✨ Deployment Complete! ✨ ║${RESET}"
93
- echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════╝${RESET}"
94
- echo ""
95
- echo -e "${BLUE}Summary:${RESET}"
96
- echo -e " • Build: ${GREEN}✓${RESET}"
97
- echo -e " • Git Push: ${GREEN}✓${RESET}"
98
- if [ "$published" = true ]; then
99
- echo -e " • NPM Publish: ${GREEN}✓${RESET}"
100
- else
101
- echo -e " • NPM Publish: ${YELLOW}Skipped${RESET}"
102
- fi
103
- echo ""
@@ -1,19 +0,0 @@
1
- #!/bin/bash
2
-
3
- cd "$(dirname "${BASH_SOURCE[0]}")"
4
-
5
- echo "Setting up Git credentials..."
6
-
7
- # Credential helper konfigurieren
8
- git config credential.helper store
9
-
10
- # Token in die credentials-Datei schreiben (mit lowercase username!)
11
- echo "https://deathnaitsa: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@github.com" > ~/.git-credentials
12
-
13
- # Push mit Token durchführen
14
- echo "Pushing to GitHub..."
15
- git push --set-upstream origin main
16
-
17
- echo ""
18
- echo "✅ Git configured and pushed successfully!"
19
- echo "You can now use ./publish.sh without entering credentials."