Created
January 17, 2020 12:15
-
-
Save 1syo/593044c64f46be76fdfdd2f85ad4c4b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run() { | |
var query = "{query}" | |
if (query == '' || isNaN(query)) { | |
query = 30; | |
} | |
var app = Application.currentApplication(); | |
app.includeStandardAdditions = true; | |
var commands = [ | |
'pwgen -y -B ' + query + ' 1', | |
'pwgen -B ' + query + ' 1' | |
]; | |
var json = {items:[]}; | |
for(var command of commands) { | |
var password = app.doShellScript("zsh --login -c '" + command + "'"); | |
json.items.push({ | |
type: "default", | |
title: password, | |
subtitle: command, | |
arg: password, | |
valid: true, | |
}) | |
} | |
return JSON.stringify(json); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment