How to use executable - 8 common examples

To help you get started, we’ve selected a few executable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arduino-cli / arduino-node / test / basics.js View on Github external
test('arduino should load and unload arduino latest', async t => {
  const arduinoObj = arduino({path: 'tmp', tag: 'load'});
  let err = await pify(arduinoObj.load)();
  t.is(err, undefined);
  const bin = await pify(arduinoObj.binary)();
  const exec = await executable(bin);
  t.is(exec, true);
  err = await pify(arduinoObj.unload)();
  t.is(err, undefined);
  const result = await exists(bin);
  t.is(result, false);
});
github archiverjs / node-archiver / test / plugins.js View on Github external
it('should append via file', function() {
      assert.property(entries, 'executable.sh');
      assert.propertyVal(entries['executable.sh'], 'uncompressedSize', 11);
      assert.propertyVal(entries['executable.sh'], 'crc32', 3957348457);
    });
github archiverjs / node-archiver / test / plugins.js View on Github external
it('should append via file', function() {
      assert.property(entries, 'executable.sh');
      assert.propertyVal(entries['executable.sh'], 'uncompressedSize', 11);
      assert.propertyVal(entries['executable.sh'], 'crc32', 3957348457);
    });
github webtorrent / webtorrent-cli / bin / cmd.js View on Github external
function checkPermission (filename) {
  try {
    if (!executable.sync(filename)) {
      return errorAndExit(`Script "${filename}" is not executable`)
    }
  } catch (err) {
    return errorAndExit(`Script "${filename}" does not exist`)
  }
}
github decaffeinate / bulk-decaffeinate / src / util / FilePaths.js View on Github external
async function isExecutableScript(path, recognizer) {
  if (isExtensionless(path) && await executable(path)) {
    let contents = await readFile(path);
    let firstLine = contents.toString().split('\n')[0];
    if (firstLine.startsWith('#!') && firstLine.includes(recognizer.shebangSuffix)) {
      return true;
    }
  }
  return false;
}
github Jalle19 / node-ffmpeg-mpegts-proxy / node-ffmpeg-mpegts-proxy.js View on Github external
var runPrePostScript = function(scriptPath, params) {
	try {
		if (executable.sync(scriptPath)) {
			child_process.spawnSync(scriptPath, params);
		} else {
			winston.error("The specified script is not executable");
		}
	}
	catch (e) {
		winston.error("The specified script doesn't exist");
	}
};
github kevva / bin-check / index.js View on Github external
module.exports.sync = (bin, args) => {
	if (!Array.isArray(args)) {
		args = ['--help'];
	}

	if (!executable.sync(bin)) {
		throw new Error(`Couldn't execute the \`${bin}\` binary. Make sure it has the right permissions.`);
	}

	return execa.sync(bin, args).status === 0;
};
github phingofficial / phing / docs / docbook5 / en / output / webhelp / search / index-2.js View on Github external
//Auto generated index for searching by xsl-webhelpindexer for DocBook Webhelp.# Kasun Gajasinghe, University of Moratuwa
w["exectask"]="257*46,389*1,453*1";
w["execut"]="10*1,15*1,17*2,33*6,39*2,42*15,53*1,54*2,58*2,81*3,98*1,103*1,106*2,109*2,111*2,129*3,131*2,132*1,142*1,151*1,177*1,179*1,182*2,200*2,201*2,226*3,234*9,237*1,238*2,241*2,242*2,257*7,278*1,314*1,315*1,317*1,318*1,325*2,338*1,356*2,357*2,359*1,365*1,369*2,380*1,389*1,392*1,399*4,405*2,410*2,412*1,422*3,448*2,451*2,460*1,464*1,465*1,486*1,504*4,518*11,521*5,523*2";
w["executable."]="42*1,365*1,460*1";
w["executables."]="42*2";
w["execute."]="111*1,241*1,359*1,405*1";
w["executed."]="33*4,39*1,58*1,201*2,226*1,234*1,257*1";
w["executing."]="257*1";
w["execution."]="17*1,182*1,242*1,325*1,356*1,357*1,389*1,448*1,518*3,523*1";
w["exercis"]="42*2";
w["exhaust"]="53*1,421*1";
w["exhaustive."]="421*1";
w["exist"]="26*1,42*1,68*1,69*1,73*1,95*1,97*2,99*2,147*1,155*1,158*1,166*1,179*1,182*1,184*1,194*1,195*1,206*1,221*5,227*1,237*1,238*1,250*1,261*1,295*1,300*1,304*1,313*1,328*2,333*4,334*1,354*2,385*1,386*2,387*1,388*1,395*1,402*1,403*2,411*1,413*1,417*1,455*1,459*1,462*2,464*1,478*1,518*1";
w["exist."]="99*2,403*2,411*1,464*1,478*1";
w["existence."]="333*1";
w["existin"]="470*1";
w["exists."]="95*1,195*1,221*1,333*1,411*1";
w["exit"]="1*1,27*1,73*1,81*53,82*3,118*3,154*1,204*1,337*1,392*3";
w["exit."]="392*2";
w["exit_cod"]="82*2";

executable

Check if a file is executable

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis