var fs=require('fs'); var files=JSON.parse(fs.readFileSync('civitai.info.json')); var moves=files.filter(file=>{ return file.model.nsfw==true && file.mirror_path.indexOf('nsfw') == -1 }); moves = moves.map(file=>{ m=file.mirror_path.replace(/\\/g,'/'); m=m.replace(/(models\/[^/]+|embeddings)\/(.+)/g,'git mv "$1/$2" "$1/nsfw/$2"'); return m; }).join('\n') fs.writeFileSync('move-nsfw.sh',moves);