How to use shell - 10 common examples

To help you get started, we’ve selected a few shell 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 OpenBazaar / OpenBazaar-Client / js / main.js View on Github external
$('body').on('click', 'a', function(e){
  var targUrl = $(e.target).closest("a").attr("href") || $(e.target).text(),
      linkPattern = /[a-zA-Z]+:\/\//; //find any text:// in link. It may not start at the first character of href

  if(targUrl.startsWith('ob')){
    e.preventDefault();
    app.router.translateRoute(targUrl.replace('ob://', '')).done((route) => {
      Backbone.history.navigate(route, {trigger:true});
    });
  } else if(linkPattern.test(targUrl) || $(this).is('.js-externalLink, .js-externalLinks a, .js-listingDescription')){
    e.preventDefault();

    if (!/^https?:\/\//i.test(targUrl)) {
      targUrl = 'http://' + targUrl;
    }
    require("shell").openExternal(targUrl);
  } else if ($(e.target).closest("a").attr("href") && !targUrl.startsWith('#')){ //internal links should start with #
    e.preventDefault(); //just ignore any anchor with an href that is not a valid internal link
  }
});
github hello-efficiency-inc / raven-reader / app / components / Main.vue View on Github external
openInBrowser(){
      // window.open(this.link);
      // window.open(this.link,'post','width=400,height=200,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes')
      require("shell").openExternal(this.link);
    },
    saveTags(id,selected){
github AtomLinter / linter-codeclimate / lib / index.js View on Github external
onDidClick: () => {
          // eslint-disable-next-line import/no-extraneous-dependencies
          require('shell').openExternal('https://github.com/codeclimate/codeclimate');
        },
        text: 'Install guide',
github jmathai / elodie / app / modules / broadcast.js View on Github external
exports.launchUrl = function(event, url) {
  console.log(url);
  var shell = require('shell');
  shell.openExternal(url);
};
github OpenBazaar / OpenBazaar-Client / js / views / aboutVw.js View on Github external
self.$el.find('a').on('click', function(e){
        e.preventDefault();
        var extUrl = $(this).attr('href');
        if (!/^https?:\/\//i.test(extUrl)) {
          extUrl = 'http://' + extUrl;
        }
        require("shell").openExternal(extUrl);
      });
      self.$el.find('.js-aboutModal').removeClass("hide");
github HR / CryptoSync / static / settings.html View on Github external
function navigate(dest) {
			var URLregex = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi;
			if (URLregex.test(dest)) {
				shell.openExternal(dest);
				return;
			}
			var oldSel = $('.panel-container > div.current');
			var currSel = $("#panel-" + dest);
			if (oldSel) oldSel.removeClass("current");
			$("#panel-" + dest).addClass("current");
		}
github spring-raining / Giraf / static / main.js View on Github external
mainWindow.webContents.on("new-window", function(e, url) {
    e.preventDefault();
    shell.openExternal(url);
  });
}
github officert / mongotron / src / ui / directives / markdown.js View on Github external
scope.openExternal = function(url, $event) {
              if (!url) return;

              if ($event) $event.preventDefault();

              shell.openExternal(url);
            };
github devspace / devspace / index.js View on Github external
mainWindow.webContents.on('new-window', function(e, url) {
    e.preventDefault();
    shell.openExternal(url);
  });
github okdistribute / dps / app / index.js View on Github external
openUrl: function (event, url) {
    shell.openExternal(url)
    event.original.preventDefault()
  },
  quit: function () {

shell

Command line arguments parser and stringifier

MIT
Latest version published 27 days ago

Package Health Score

65 / 100
Full package analysis

Popular shell functions