Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
goya committed Apr 9, 2018
0 parents commit b715acd
Show file tree
Hide file tree
Showing 183 changed files with 5,317 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["minify"]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib
tmp
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
plugins: ['jest'],
rules: {
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'never'
}],
camelcase: 'off'
},
env: {
'jest/globals': true
},
"globals": {
"pgb": true
},
extends: ['plugin:jest/recommended', 'standard']
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
npm-debug.log*
node_modules
*.log
tmp
yarn.lock
package-lock.json
releases
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
!bin/*
!lib/*
!completions/*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Brett Rudd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# pgb-cli <a href=https://www.npmjs.com/package/pgb-cli><img alt=npm src=https://badge.fury.io/js/pgb-cli.svg></a>
This is a nodejs CLI module to access [PhoneGap Build](https://build.phonegap.com).

The CLI can be installed by

```bash
> yarn global add pgb-cli

or

> npm install -g pgb-cli

or

> brew tap phonegap-build/build
> brew install bash-completion or zsh-completions # only required for command completion
> brew install pgb
```

If you don't have (or don't want) node installed you can download executables for Mac OSX, Linux and Windows [here](https://github.com/phonegap-build/pgb-cli/releases/latest)

Here is a snippet to print out your apps to the console:

```bash
> pgb ls
```

Here is the full list of commands:

```
Usage: pgb [OPTIONS] COMMAND [arg...]
pgb [ --help | -? | --version | -v ]
Options:
-d, --debug Enable debug mode
-f, --force Skip confirmation
-j, --json Print raw json
--no-progress Don't show progress
-c, --no-colours Don't use colors
-v, --version Print version
-?, --help Print usage
-b, --bare Print numerical ids
Commands:
app Show information about an app
build Build an app
clone Shortcut to update and build a repo backed app
download Download an app package
lock Lock a signing key
log Show a build log
login Sign in to PhoneGap Build
logout Sign out of PhoneGap Build
ls List your apps
key Show information about a signing key
keys List your signing keys
new Create an app from a repository, file or directory
new-key Create a signing key
phonegaps List supported versions of PhoneGap
rm Delete an app
rm-key Delete a signing key
unlock Unlock a signing key
update Update an app
update-key Update a signing key
whoami Show signed in user
Run 'pgb COMMAND --help' for more information on a command
```

If you find a bug or have a feature request tell me about it [here](https://github.com/phonegap-build/pgb-cli/issues).

Follow me on twitter **@brettrudd**
3 changes: 3 additions & 0 deletions bin/pgb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node
global.pgb = require('../lib')()
global.pgb.run()
29 changes: 29 additions & 0 deletions completions/pgb.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
_pgb_complete() {
COMPREPLY=()
local word="${COMP_WORDS[COMP_CWORD]}"
local args=""
local COUNTER=1
while [ $COUNTER -le $# ]; do
args="$args ${COMP_WORDS[$COUNTER]}"
let COUNTER=COUNTER+1
done
local completions="$(pgb $args --completion idx=$((COMP_CWORD-1)) word=$word)"
case $completions in
'') # default
complete -o default -o bashdefault -F _pgb_complete pgb
;;
-x*) # disable completions
complete -F _pgb_complete pgb
;;
-n*) # nospace
COMPREPLY+=( $(compgen -W "${completions:3}" -- "$word") )
complete -o nospace -F _pgb_complete pgb
;;
*) # use matches only
COMPREPLY+=( $(compgen -W "$completions" -- "$word") )
complete -F _pgb_complete pgb
;;
esac
}

complete -F _pgb_complete pgb
32 changes: 32 additions & 0 deletions completions/pgb.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
autoload -Uz compinit && autoload -Uz bashcompinit
compinit && bashcompinit

_pgb_complete() {
COMPREPLY=()
local word="${COMP_WORDS[COMP_CWORD]}"
local args=""
local COUNTER=1
while [ $COUNTER -le $# ]; do
args="$args ${COMP_WORDS[$COUNTER]}"
let COUNTER=COUNTER+1
done
local completions="$(pgb $args --completion idx=$((COMP_CWORD-1)) word=$word)"
case $completions in
'') # default
complete -o default -o bashdefault -F _pgb_complete pgb
;;
-x*) # disable completions
complete -F _pgb_complete pgb
;;
-n*) # nospace
COMPREPLY+=( $(compgen -W "${completions:3}" -- "$word") )
complete -o nospace -F _pgb_complete pgb
;;
*) # use matches only
COMPREPLY+=( $(compgen -W "$completions" -- "$word") )
complete -F _pgb_complete pgb
;;
esac
}

complete -F _pgb_complete pgb
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
collectCoverage: true,
verbose: false,
collectCoverageFrom: [ 'src/**/*.js' ],
testRegex: '/test/[^_]*/*.js$',
coverageDirectory: 'tmp/coverage',
setupFiles: [
'<rootDir>/test/_helpers/globals.js',
'jest-plugin-fs/setup'
],
timers: 'fake',
coverageThreshold: {
global: {
lines: 100,
branches: 100,
statements: 100
}
}
}
1 change: 1 addition & 0 deletions lib/commands/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/completion.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/download.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/help.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/helpers/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/helpers/bind-progress.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/helpers/complete.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/helpers/formatters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/helpers/payload.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/helpers/unlock-key.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/helpers/validators.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions lib/commands/helpers/wait.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/key.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/keys.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/lock.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/log.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/login.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/commands/logout.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b715acd

Please sign in to comment.