@testcomplete/filesystemutil
Version:
A file system interface to let scripts working with TestComplete & NodeJS at the same time
16 lines (12 loc) • 430 B
JavaScript
// Check for NodeJS. If NodeJS, require need relative path
let sPrePath = typeof process !== 'undefined' ? './' : '';
let fs = require(`${sPrePath}FileSystemUtil`);
function dExists () {
let sFile = './MyFileToDeleteOnlyExists.txt';
if (fs().exists(sFile)) {
Log.message(`File ${sFile} exists. Deletion.`);
fs().delete(sFile)
} else {
Log.message(`File ${sFile} does not exists.`);
}
}