IOS app test
var fs = require('fs'); var path = require('path'); // configuring source code generation var sourceCodeDir = path.join(__dirname, 'CaseAide'); var destinationPath = path.join(__dirname, 'sc.txt'); var title = "CaseAide Source code"; var captureExtensions = ['.swift']; var captureFiles = ['AbbrWordDict.json']; fs.writeFileSync(destinationPath, `${title}\n\n\n`); fs.readdir(sourceCodeDir, function (err, files) { files.forEach(function (file) { var ext = path.extname(file); // if files extension is in list of extensions we are capturing or if the file name is listed in list of captured files if (captureExtensions.indexOf(ext) !== -1 || captureFiles.indexOf(file) !== -1) { var filePath = path.join(sourceCodeDir, file); fs.readFile(filePath, 'UTF-8', function (err, data) { fs.appendFile(destinationPath, '\n\n' + file + '\n' + data); }); } }); });