Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (-1 != ignore.indexOf(dirEntry))
continue;
var linkName = dirEntry;
var realBaseName = dirEntry;
var realLoc = scanPath + path.sep + dirEntry;
var entryStat = fs.lstatSync(realLoc);
if (entryStat.isSymbolicLink()) {
realLoc = fs.realpathSync(realLoc);
entryStat = fs.statSync(realLoc);
realBaseName = realLoc.split(/[\\/]/).pop();
}
if (entryStat.isDirectory()) {
var modEntry = fromJS([]).asMutable();
var isMod = false;
// check if it's a mod
var modName = this.parseFileForName(realLoc + path.sep + "mod.cpp");
var metaName = this.parseFileForName(realLoc + path.sep + "meta.cpp");
if (!modName && !metaName) {
// last try: check for addons directory
if (this.checkDirAccessible(realLoc + path.sep + "addons") || this.checkDirAccessible(realLoc + path.sep + "Addons")) {
isMod = true;
modName = metaName = ""; //dirEntry;
if (this.isAllNumbers(dirEntry) && !this.isAllNumbers(realBaseName)) {
linkName = realBaseName;
}
} else {
console.log("Failed entry: " + dirEntry + ": no .cpp files, no addons directory");
}
} else {
isMod = true;
if (!!modName && !!metaName) {
if (modName.length < metaName.length) {
render={({ site: { siteMetadata: seo } }) => {
const postMeta =
frontmatter || postData.childMarkdownRemark.frontmatter || {};
const title = postMeta.title || seo.title;
const description = postMeta.description || seo.description;
const image = postImage ? `${seo.canonicalUrl}${postImage}` : seo.image;
const url = postMeta.slug
? `${seo.canonicalUrl}${path.sep}${postMeta.slug}`
: seo.canonicalUrl;
const datePublished = isBlogPost ? postMeta.datePublished : false;
return (
{/* General tags */}
<title>{title}</title>
{/* OpenGraph tags */}
{isBlogPost ? : null}
return (dispatch, getState) => {
// @if TARGET='app'
const state = getState();
// Make a new directory within temp directory so the filename is guaranteed to be available
const dir = Fs.mkdtempSync(remote.app.getPath('temp') + path.sep);
const upgradeFilename = selectUpgradeFilename(state);
const options = {
onProgress: p => dispatch(doUpdateDownloadProgress(Math.round(p * 100))),
directory: dir,
};
download(remote.getCurrentWindow(), selectUpdateUrl(state), options).then(downloadItem => {
/**
* TODO: get the download path directly from the download object. It should just be
* downloadItem.getSavePath(), but the copy on the main process is being garbage collected
* too soon.
*/
dispatch({
type: ACTIONS.UPGRADE_DOWNLOAD_COMPLETED,
data: {
export function shortenPath (file) {
return path.normalize(file).split(path.sep).slice(-2).join(path.sep)
}
export function location (file, line) {
fs.readdirSync = (directoryPath) => {
const pathArr = directoryPath.split(path.sep);
return Object.keys(R.path(pathArr, mockFiles)) || [];
};
paths.map(function(a_path)
{
var parts = a_path.split(path.sep)
if (parts[parts.length - 1] === 'node_modules')
{
parts[parts.length - 1] = ''
return parts.join(path.sep)
}
})
.filter(function(a_path)
it('should create a new PageObjectFile', () => {
let fileStructure = new FileStructure(path.join(path.sep, 'file-structure'));
let filePath = path.join(path.sep, 'file-structure', 'directory', 'file');
let file = new DiffPNGFile(filePath, fileStructure);
expect(file).to.be.an.instanceof(DiffPNGFile);
});
app.get('/servdir', (req, res) => res.send(process.cwd() + path.sep));
}
function onGetSystemFacts() {
return bluebird.props({
homedir: os.homedir(),
pathSep: path.sep,
delimiter: path.delimiter
}).timeout(systemFactTimeout * second, 'Unable to call "get system facts" in under ' + systemFactTimeout + ' seconds');
}
getResource(){
let filename = this.__filename || __filename;
let last = filename.lastIndexOf(path.sep);
return filename.substr(last + 1, filename.length - last - 4);
}
/**