You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2023. It is now read-only.
- Update name of this deploy script repo (it's no longer focused on using Git Flow).
- Add summary of steps to top comments.
- Bump to version 3.0.0.
- Change question numbers.
- Change from deprecated backticks to dollar parens format.
- Remove notes on not have trailing slash, as this is already handled.
- Re-order questions, so intermediate checks can be done, and if necessary, fail early.
- Check local plugin (Git) directory exists.
- Check main plugin file exists.
- Remove `GITPATH` variable, as it was mostly unused.
- Added empty lines between sections of output for readability.
- Check git tag exists (must exactly match plugin version).
echo"1b) Path to a local directory where a temporary SVN checkout can be made."
27
-
printf"No trailing slash and don't add trunk ($default_svnpath): "
28
-
read -e input
49
+
echo"Q2. Your local plugin root directory (the Git repo)."
50
+
printf"($default_plugindir): "
51
+
read -e input
29
52
input="${input%/}"# Strip trailing slash
30
-
SVNPATH="${input:-$default_svnpath}"# Populate with default if empty
53
+
PLUGINDIR="${input:-$default_plugindir}"# Populate with default if empty
31
54
echo
32
55
33
-
echo"1c) Remote SVN repo on WordPress.org. No trailing slash."
34
-
printf"($default_svnurl): "
56
+
# Check directory exists.
57
+
if [ !-d"$PLUGINDIR" ];then
58
+
echo"Directory $PLUGINDIR not found. Aborting."
59
+
exit 1;
60
+
fi
61
+
62
+
printf"Q3. Name of the main plugin file ($default_mainfile): "
35
63
read -e input
36
-
input="${input%/}"# Strip trailing slash
37
-
SVNURL="${input:-$default_svnurl}"# Populate with default if empty
64
+
MAINFILE="${input:-$default_mainfile}"# Populate with default if empty
65
+
echo
66
+
67
+
# Check main plugin file exists.
68
+
if [ !-f"$PLUGINDIR/$MAINFILE" ];then
69
+
echo"Plugin file $PLUGINDIR/$MAINFILE not found. Aborting."
70
+
exit 1;
71
+
fi
72
+
73
+
echo"Checking version in main plugin file matches version in readme.txt file..."
38
74
echo
39
75
40
-
printf"1d) Your WordPress repo SVN username ($default_svnuser): "
76
+
# Check version in readme.txt is the same as plugin file after translating both to Unix line breaks to work around grep's failure to identify Mac line breaks
echo"Version in readme.txt & $MAINFILE don't match, but Stable tag is trunk. Let's continue..."
84
+
elif [ "$PLUGINVERSION"!="$READMEVERSION" ];then
85
+
echo"Version in readme.txt & $MAINFILE don't match. Exiting...."
86
+
exit 1;
87
+
elif [ "$PLUGINVERSION"="$READMEVERSION" ];then
88
+
echo"Versions match in readme.txt and $MAINFILE. Let's continue..."
89
+
fi
90
+
91
+
echo
92
+
93
+
echo"Q4. Path to a local directory where a temporary SVN checkout can be made."
94
+
printf"Don't add trunk ($default_svnpath): "
41
95
read -e input
42
-
SVNUSER="${input:-$default_svnuser}"# Populate with default if empty
96
+
input="${input%/}"# Strip trailing slash
97
+
SVNPATH="${input:-$default_svnpath}"# Populate with default if empty
43
98
echo
44
99
45
-
echo"1e) Your local plugin root directory, the Git repo. No trailing slash."
46
-
printf"($default_plugindir): "
47
-
read -e input
100
+
echo"Q5. Remote SVN repo on WordPress.org."
101
+
printf"($default_svnurl): "
102
+
read -e input
48
103
input="${input%/}"# Strip trailing slash
49
-
PLUGINDIR="${input:-$default_plugindir}"# Populate with default if empty
104
+
SVNURL="${input:-$default_svnurl}"# Populate with default if empty
50
105
echo
51
106
52
-
printf"1f) Name of the main plugin file ($default_mainfile): "
107
+
printf"Q6. Your WordPress repo SVN username ($default_svnuser): "
53
108
read -e input
54
-
MAINFILE="${input:-$default_mainfile}"# Populate with default if empty
109
+
SVNUSER="${input:-$default_svnuser}"# Populate with default if empty
55
110
echo
56
111
57
112
echo"That's all of the data collected."
58
113
echo
59
114
echo"Slug: $PLUGINSLUG"
115
+
echo"Plugin directory: $PLUGINDIR"
116
+
echo"Main file: $MAINFILE"
60
117
echo"Temp checkout path: $SVNPATH"
61
118
echo"Remote SVN repo: $SVNURL"
62
119
echo"SVN username: $SVNUSER"
63
-
echo"Plugin directory: $PLUGINDIR"
64
-
echo"Main file: $MAINFILE"
65
120
echo
66
121
67
122
printf"OK to proceed (Y|n)? "
@@ -72,9 +127,6 @@ echo
72
127
# Allow user cancellation
73
128
if [ $(echo "$PROCEED"|tr [:upper:] [:lower:])!="y" ];thenecho"Aborting...";exit 1;fi
74
129
75
-
# git config
76
-
GITPATH="$PLUGINDIR/"# this file should be in the base of your git repository
77
-
78
130
# Let's begin...
79
131
echo".........................................."
80
132
echo
@@ -83,48 +135,24 @@ echo
83
135
echo".........................................."
84
136
echo
85
137
86
-
# Check version in readme.txt is the same as plugin file after translating both to unix line breaks to work around grep's failure to identify mac line breaks
0 commit comments