miolo 3.0.0-beta.152 → 3.0.0-beta.153
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/package.json +1 -1
- package/template/db/init.sh +15 -42
- package/template/package.json +3 -3
package/package.json
CHANGED
package/template/db/init.sh
CHANGED
|
@@ -33,53 +33,26 @@ if ! command -v psql &> /dev/null; then
|
|
|
33
33
|
exit 1
|
|
34
34
|
fi
|
|
35
35
|
|
|
36
|
-
#
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
# Ask for confirmation
|
|
37
|
+
echo ""
|
|
38
|
+
read -p "Do you want to create/recreate database '$DB_NAME'? (y/N): " -n 1 -r
|
|
39
|
+
echo
|
|
40
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
41
|
+
echo "Database creation skipped"
|
|
42
|
+
echo "Proceeding with SQL execution only..."
|
|
43
|
+
else
|
|
44
|
+
# Try to create database with sudo
|
|
45
|
+
echo -e "${YELLOW}Creating database as postgres user (requires sudo)...${NC}"
|
|
39
46
|
|
|
40
|
-
if
|
|
41
|
-
echo -e "${
|
|
42
|
-
sudo -u postgres createdb "$DB_NAME" 2>/dev/null
|
|
43
|
-
else
|
|
44
|
-
echo -e "${YELLOW}Attempting to create database as current user...${NC}"
|
|
45
|
-
createdb "$DB_NAME" 2>/dev/null
|
|
46
|
-
fi
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
# Try to create database
|
|
50
|
-
DB_EXISTS=$(psql -lqt 2>/dev/null | cut -d \| -f 1 | grep -w "$DB_NAME" | wc -l)
|
|
51
|
-
|
|
52
|
-
if [ "$DB_EXISTS" -eq 1 ]; then
|
|
53
|
-
echo -e "${YELLOW}Database '$DB_NAME' already exists${NC}"
|
|
54
|
-
read -p "Drop and recreate? (y/N): " -n 1 -r
|
|
55
|
-
echo
|
|
56
|
-
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
57
|
-
echo "Dropping database..."
|
|
58
|
-
if dropdb "$DB_NAME" 2>/dev/null; then
|
|
59
|
-
echo -e "${GREEN}✓ Database dropped${NC}"
|
|
60
|
-
else
|
|
61
|
-
sudo -u postgres dropdb "$DB_NAME"
|
|
62
|
-
echo -e "${GREEN}✓ Database dropped (as postgres user)${NC}"
|
|
63
|
-
fi
|
|
47
|
+
if sudo -u postgres createdb "$DB_NAME" 2>/dev/null; then
|
|
48
|
+
echo -e "${GREEN}✓ Database '$DB_NAME' created${NC}"
|
|
64
49
|
else
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
# Database creation failed - probably already exists, continue anyway
|
|
51
|
+
echo -e "${YELLOW}⚠ Database creation failed (database may already exist)${NC}"
|
|
52
|
+
echo -e "${YELLOW}Continuing with SQL execution...${NC}"
|
|
67
53
|
fi
|
|
68
54
|
fi
|
|
69
55
|
|
|
70
|
-
# Try to create database with current user first
|
|
71
|
-
if create_database "current"; then
|
|
72
|
-
echo -e "${GREEN}✓ Database '$DB_NAME' created${NC}"
|
|
73
|
-
elif create_database "postgres"; then
|
|
74
|
-
echo -e "${GREEN}✓ Database '$DB_NAME' created (as postgres user)${NC}"
|
|
75
|
-
else
|
|
76
|
-
echo -e "${RED}Error: Failed to create database${NC}"
|
|
77
|
-
echo ""
|
|
78
|
-
echo "To avoid using sudo, grant CREATEDB permission to your user:"
|
|
79
|
-
echo " sudo -u postgres psql -c \"ALTER USER $USER CREATEDB;\""
|
|
80
|
-
exit 1
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
56
|
# Execute SQL files in order
|
|
84
57
|
echo ""
|
|
85
58
|
echo -e "${YELLOW}Executing SQL files...${NC}"
|
package/template/package.json
CHANGED
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"intre": "^3.0.0-beta.3",
|
|
46
46
|
"joi": "^18.0.2",
|
|
47
47
|
"lucide-react": "^0.563.0",
|
|
48
|
-
"miolo-cli": "^3.0.0-beta.
|
|
49
|
-
"miolo-react": "^3.0.0-beta.
|
|
48
|
+
"miolo-cli": "^3.0.0-beta.153",
|
|
49
|
+
"miolo-react": "^3.0.0-beta.153",
|
|
50
50
|
"next-themes": "^0.4.6",
|
|
51
51
|
"radix-ui": "^1.4.3",
|
|
52
52
|
"react": "^19.2.4",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"tw-animate-css": "^1.4.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"miolo": "^3.0.0-beta.
|
|
63
|
+
"miolo": "^3.0.0-beta.153",
|
|
64
64
|
"sass-embedded": "^1.97.3",
|
|
65
65
|
"xeira": "^2.0.0-beta.10"
|
|
66
66
|
},
|