-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlegal.js
1 lines (1 loc) · 1.06 KB
/
legal.js
1
const fs=require("fs"),path=require("path");function updateFile(e,r){fs.readFile(r,"utf8",(t,a)=>{if(t)return void console.error(`Error reading the destination file (${r}):`,t);const i=a.indexOf("---",3)+3,s=a.substring(0,i);fs.readFile(e,"utf8",(t,a)=>{if(t)return void console.error(`Error reading the source file (${e}):`,t);let i=a.replace(/passwords:\/\/contact\?subject=/g,"mailto:[email protected]?subject=[Passwords%20App]%20[Web]%20");i=s+"\n"+i,fs.writeFile(r,i,"utf8",e=>{e?console.error(`Error writing to the destination file (${r}):`,e):console.log(`The header has been preserved, and the content has been copied and modified successfully for ${r}.`)})})})}const privacySourcePath=path.join(__dirname,"/faq.passwords.2stable.com/legal/privacy.md"),privacyDestinationPath=path.join(__dirname,"/pages/privacy-policy.md"),termsSourcePath=path.join(__dirname,"/faq.passwords.2stable.com/legal/terms.md"),termsDestinationPath=path.join(__dirname,"/pages/terms-of-service.md");updateFile(privacySourcePath,privacyDestinationPath),updateFile(termsSourcePath,termsDestinationPath);