Skip to content

Commit fba8faa

Browse files
committed
feat: add replace string
1 parent e8c86c9 commit fba8faa

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

replace-string.cjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,22 @@ function replaceString(str) {
9090
to: kebabName,
9191
})
9292

93+
replace.sync({
94+
files: [
95+
'./package.json',
96+
],
97+
from: /create-wp-react-plugin/g,
98+
to: kebabName,
99+
})
100+
101+
replace.sync({
102+
files: [
103+
'./package.json',
104+
],
105+
from: /"version": "[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}"/,
106+
to: '"version": "0.0.1"',
107+
})
108+
93109
replace.sync({
94110
files: [
95111
'./plugin.php',
@@ -126,6 +142,10 @@ function replaceString(str) {
126142
from: '* Author: J7',
127143
to: '* Author: Your Name',
128144
},
145+
{
146+
from: "'app_name' => 'Wp React Plugin'",
147+
to: `'app_name' => '${str}'`,
148+
},
129149
{
130150
from: 'https://github.com/j7-dev',
131151
to: '[YOUR GITHUB URL]',
@@ -145,6 +165,8 @@ function replaceString(str) {
145165
to,
146166
})
147167
})
168+
169+
148170
}
149171

150172
replaceString(projectName)

0 commit comments

Comments
 (0)