WIP: Build & Release
This commit is contained in:
@@ -15,7 +15,7 @@ module.exports = async ({ github, context, core, jobId }) => {
|
|||||||
|
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
let data = require('fs').readFileSync(file, 'utf8');
|
let data = require('fs').readFileSync(file, 'utf8');
|
||||||
const regex = /#{(.*?)}/g;
|
const regex = /#{(.*?)}#/g;
|
||||||
let match;
|
let match;
|
||||||
while (match = regex.exec(data)) {
|
while (match = regex.exec(data)) {
|
||||||
const original = match[0];
|
const original = match[0];
|
||||||
@@ -25,8 +25,9 @@ module.exports = async ({ github, context, core, jobId }) => {
|
|||||||
core.setFailed(`Token ${token} not found`);
|
core.setFailed(`Token ${token} not found`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
data = data.replace(new RegExp(`#{${original}}`, 'g'), value);
|
data = data.replace(new RegExp(`#{${original}}#`, 'g'), value);
|
||||||
console.log(`Replaced ${original} with ${value} (${token}) in ${file}`);
|
console.log(`Replaced ${original} with ${value} (${token}) in ${file}`);
|
||||||
|
console.log(data);
|
||||||
}
|
}
|
||||||
console.log(data);
|
console.log(data);
|
||||||
require('fs').writeFileSync(file, data, 'utf8');
|
require('fs').writeFileSync(file, data, 'utf8');
|
||||||
|
|||||||
Reference in New Issue
Block a user