/** * @public * @description This function starts service * @example * gladys.services['rtsp-camera'].start(); */ async function start() { logger.log('starting RTSP service'); // make sure the tempFolder exists await fse.ensureDir(gladys.config.tempFolder); }
/** * @description Init the system, connect to docker if in docker * @example * init(); */ async function init() { // Clean temp folder await fse.emptyDir(this.config.tempFolder); // Ensure temp directory exists await fse.ensureDir(this.config.tempFolder); // we get Gladys version from package.json const packageJsonString = await fse.readFile(path.join(__dirname, '../../../package.json'), 'utf8'); const packageJson = JSON.parse(packageJsonString); // and save it in the object this.gladysVersion = `v${packageJson.version}`; try { // we create a new dockerode instance const dockerode = new this.Docker(); // if we can contact a docker daemon, this should not fail await dockerode.listContainers(); // and we should go there. // If it fails, it will go to catch and it means // docker dameon is not available on this machine. this.dockerode = dockerode; } catch (e) { if (e && e.errno === 'ENOENT') { logger.info(`System.init: This system doesn't have a docker dameon available.`); } } }
yield fs.ensureDir(path.dirname(absTo)); yield fs.writeFile(absTo, action.body);
await fs.ensureDir(dest);
const encryptedBackupFilePath = `${compressedBackupFilePath}.enc`; await fse.ensureDir(this.config.backupsFolder);
describe('RtspCameraManager commands', () => { const rtspCameraManager = new RtspCameraManager(gladys, FfmpegMock, 'de051f90-f34a-4fd5-be2e-e502339ec9bc'); before(async () => { await fse.ensureDir(gladys.config.tempFolder); }); it('should start service', async () => {
const backupFilePath = path.join(restoreFolderPath, `${encryptedBackupName}.db`); await fse.ensureDir(restoreFolderPath);
async writePluginFile(root, path, config) { await fse.ensureDir(root) await fse.ensureFile(path) await fse.writeJson(path, config, { spaces: '\t' }) }
const createCopy = async () => { const root = path.resolve(__dirname, '../fixtures'); const copyDir = path.resolve(__dirname, '..', `test-dir-${Math.random().toString(36).slice(2)}`); await fs.ensureDir(copyDir); await fs.copy(root, copyDir); return copyDir; }
async function fetchFromGit(cwd, repo, commit) { await fs.ensureDir(cwd); await exec('init'); await exec('remote', 'add', 'origin', repo); await exec('fetch', 'origin', commit); await exec('reset', '--hard', 'FETCH_HEAD'); await fs.remove(path.join(cwd, '.git')); function exec(...options) { return execa('git', options, { cwd }); } }
const buildJs = async ({inputOptions, outputOptions}) => { await fs.ensureDir(dist_js_directory); const bundle = await rollup(inputOptions); await bundle.write(outputOptions); }
/** * @public * @description This function starts service * @example * gladys.services['rtsp-camera'].start(); */ async function start() { logger.log('starting RTSP service'); // make sure the tempFolder exists await fse.ensureDir(gladys.config.tempFolder); }
/** * @public * @description This function starts service * @example * gladys.services['rtsp-camera'].start(); */ async function start() { logger.log('starting RTSP service'); // make sure the tempFolder exists await fse.ensureDir(gladys.config.tempFolder); }
async writeAndroidPluginFile(root, path, config) { await fse.ensureDir(root) await fse.ensureFile(path) await fse.writeJson(path, config, { spaces: '\t' }) }