@scandipwa/magento-scripts 2.4.7-alpha.1 → 2.4.8
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.
|
@@ -33,12 +33,13 @@ OLD_BRANCH=$(git name-rev --name-only "$OLD_REF" 2>/dev/null | sed 's/^remotes\/
|
|
|
33
33
|
NEW_BRANCH=$(git name-rev --name-only "$NEW_REF" 2>/dev/null | sed 's/^remotes\///' || echo "$NEW_REF")
|
|
34
34
|
|
|
35
35
|
MESSAGE_TITLE="Composer dependencies changed"
|
|
36
|
-
MESSAGE_BODY="Changes detected in: $CHANGED_DIR\nBranch: $OLD_BRANCH → $NEW_BRANCH\n\nPlease run composer install or npm run start"
|
|
36
|
+
MESSAGE_BODY="Changes detected in: $CHANGED_DIR\nBranch: $OLD_BRANCH → $NEW_BRANCH\n\nPlease run composer install (in CLI) or npm run start"
|
|
37
37
|
|
|
38
38
|
# Cross-platform desktop notification with multiple fallbacks
|
|
39
39
|
send_notification() {
|
|
40
40
|
local title="$1"
|
|
41
41
|
local body="$2"
|
|
42
|
+
local mac_alert_file="/tmp/.git_postcheckout_alert_shown"
|
|
42
43
|
|
|
43
44
|
# Try Linux notify-send first
|
|
44
45
|
if command -v notify-send >/dev/null 2>&1; then
|
|
@@ -46,15 +47,25 @@ send_notification() {
|
|
|
46
47
|
return 0
|
|
47
48
|
fi
|
|
48
49
|
|
|
49
|
-
# Try macOS terminal-notifier
|
|
50
|
+
# Try macOS terminal-notifier (alert once, then notification)
|
|
50
51
|
if command -v terminal-notifier >/dev/null 2>&1; then
|
|
51
|
-
|
|
52
|
+
if [ ! -f "$mac_alert_file" ]; then
|
|
53
|
+
terminal-notifier -title "$title" -message "$body" -sound Basso
|
|
54
|
+
touch "$mac_alert_file"
|
|
55
|
+
else
|
|
56
|
+
terminal-notifier -title "$title" -message "$body" -timeout 8
|
|
57
|
+
fi
|
|
52
58
|
return 0
|
|
53
59
|
fi
|
|
54
60
|
|
|
55
|
-
# Try macOS osascript (AppleScript) as fallback
|
|
61
|
+
# Try macOS osascript (AppleScript) as fallback (alert once, then notification)
|
|
56
62
|
if command -v osascript >/dev/null 2>&1; then
|
|
57
|
-
|
|
63
|
+
if [ ! -f "$mac_alert_file" ]; then
|
|
64
|
+
osascript -e "display alert \"$title\" message \"$body\""
|
|
65
|
+
touch "$mac_alert_file"
|
|
66
|
+
else
|
|
67
|
+
osascript -e "display notification \"$body\" with title \"$title\""
|
|
68
|
+
fi
|
|
58
69
|
return 0
|
|
59
70
|
fi
|
|
60
71
|
|
|
@@ -64,3 +75,8 @@ send_notification() {
|
|
|
64
75
|
}
|
|
65
76
|
|
|
66
77
|
send_notification "$MESSAGE_TITLE" "$MESSAGE_BODY"
|
|
78
|
+
|
|
79
|
+
echo ""
|
|
80
|
+
echo "$MESSAGE_TITLE"
|
|
81
|
+
echo ""
|
|
82
|
+
echo "$MESSAGE_BODY"
|
|
@@ -36,6 +36,11 @@ const createGitHookNotification = () => ({
|
|
|
36
36
|
})
|
|
37
37
|
])
|
|
38
38
|
|
|
39
|
+
if (gitRootResult.code === 128) {
|
|
40
|
+
task.skip('not a git repository')
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
if (gitRootResult.code !== 0) {
|
|
40
45
|
throw new UnknownError(
|
|
41
46
|
`Unexpected error accrued during git hook notification creation\n\n${gitRootResult.result}`
|
|
@@ -68,7 +73,7 @@ const createGitHookNotification = () => ({
|
|
|
68
73
|
|
|
69
74
|
tasks.push({
|
|
70
75
|
title: 'Copying Git Hook Template',
|
|
71
|
-
skip: async () =>
|
|
76
|
+
skip: async () => await pathExists(gitHookPath),
|
|
72
77
|
task: async () => {
|
|
73
78
|
await fs.promises.cp(gitHookTemplatePath, gitHookPath)
|
|
74
79
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Scripts and configuration used by CMA.",
|
|
4
4
|
"homepage": "https://docs.create-magento-app.com/",
|
|
5
5
|
"repository": "github:scandipwa/create-magento-app",
|
|
6
|
-
"version": "2.4.
|
|
6
|
+
"version": "2.4.8",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./typings/index.d.ts",
|
|
9
9
|
"license": "OSL-3.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"@types/node": "^20.14.11",
|
|
60
60
|
"@types/yargs": "^17.0.32"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "f3b396e1d55aa323326cc49ebe03faed8b6eed46"
|
|
63
63
|
}
|