|
@@ -9,7 +9,7 @@ import npcInit from "./src/npcInit.js";
|
|
import skillDefinitions from "./src/skillDefinitions.js";
|
|
import skillDefinitions from "./src/skillDefinitions.js";
|
|
import wardrobeItems from "./src/wardrobeItems.js";
|
|
import wardrobeItems from "./src/wardrobeItems.js";
|
|
|
|
|
|
-
|
|
|
|
|
|
+const thisFilesHash = md5(fs.readFileSync(__filename,{encoding: 'utf8'}));
|
|
|
|
|
|
//https://stackoverflow.com/a/25221100/7200161
|
|
//https://stackoverflow.com/a/25221100/7200161
|
|
function baseFileName(fullpath){
|
|
function baseFileName(fullpath){
|
|
@@ -53,7 +53,7 @@ function convertFile(task){
|
|
const qsrc2twResult = JSON.parse(qsrc2twResultMatch[1]);
|
|
const qsrc2twResult = JSON.parse(qsrc2twResultMatch[1]);
|
|
|
|
|
|
if((qsrc2twResult.code && codeHash == qsrc2twResult.code) &&
|
|
if((qsrc2twResult.code && codeHash == qsrc2twResult.code) &&
|
|
- (qsrc2twResult.version && VERSION == qsrc2twResult.version)){
|
|
|
|
|
|
+ (qsrc2twResult.version && thisFilesHash == qsrc2twResult.version)){
|
|
return [0,"EXISTS"];
|
|
return [0,"EXISTS"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -119,7 +119,7 @@ function convertFile(task){
|
|
return [2,"Invalid convertFunction"];
|
|
return [2,"Invalid convertFunction"];
|
|
}else{
|
|
}else{
|
|
twineCode = twineCodeRaw.split('\n')
|
|
twineCode = twineCodeRaw.split('\n')
|
|
- .toSpliced(1,0,`<!--qsrc2twResult={"version":${VERSION},"code":"${codeHash}","time":"${(new Date().toISOString())}"}-->`)
|
|
|
|
|
|
+ .toSpliced(1,0,`<!--qsrc2twResult={"version":"${thisFilesHash}","code":"${codeHash}","time":"${(new Date().toISOString())}"}-->`)
|
|
.join('\n');
|
|
.join('\n');
|
|
fs.writeFile(outFilePath, twineCode, err => {
|
|
fs.writeFile(outFilePath, twineCode, err => {
|
|
if (err) {
|
|
if (err) {
|