Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
url.indexOf(routeWithoutTrailingSlash + '/') < 0) {
const redirectUrl = routeWithoutTrailingSlash + '/' + url.slice(routeWithoutTrailingSlash.length);
log.debug(`redirect: url=${chalk.yellow(url)}, redirectUrl=${chalk.yellow(redirectUrl)}`);
res.redirect(301, redirectUrl);
return;
}
next();
});
return app;
}
});
} else {
// expandTilde('~') => '/Users/'
const directory = expandTilde(ensureString(mount.target)).trim();
log.info(`Mounting a directory ${chalk.yellow(JSON.stringify(directory))} to serve requests starting with ${chalk.yellow(mount.route)}`);
if (!directory) {
log.error(`The directory path ${chalk.yellow(JSON.stringify(directory))} must not be empty.`);
return;
}
if (!path.isAbsolute(directory)) {
log.error(`The directory path ${chalk.yellow(JSON.stringify(directory))} must be absolute.`);
return;
}
if (!fs.existsSync(directory)) {
log.error(`The directory path ${chalk.yellow(JSON.stringify(directory))} does not exist.`);
return;
}
const expandedPaths = paths.map(_path => expandTilde(_path));
* @format
*/
import {Button, ButtonGroup, writeBufferToFile} from 'flipper';
import React, {Component} from 'react';
import {connect} from 'react-redux';
import expandTilde from 'expand-tilde';
import {remote} from 'electron';
import path from 'path';
import {reportPlatformFailures} from '../utils/metrics';
import config from '../utils/processConfig';
import BaseDevice from '../devices/BaseDevice';
import {State as Store} from '../reducers';
import open from 'open';
const CAPTURE_LOCATION = expandTilde(
config().screenCapturePath || remote.app.getPath('desktop'),
);
type OwnProps = {};
type StateFromProps = {
selectedDevice: BaseDevice | null | undefined;
};
type DispatchFromProps = {};
type State = {
recording: boolean;
recordingEnabled: boolean;
capturingScreenshot: boolean;
};