blob: 0a76c5571c2b7826b94545a189a6f839a1025d20 [file] [log] [blame]
#!/bin/bash
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
### push packages to a device
## usage: fx push-package [pkg1 pkg2 ...]
##
## Push packages to a device. One or more package names may be supplied. If no
## package name is suppled all packages in the build output will be pushed. The
## target must be reachable from the host and most already know the host's IP
## address.
##
## See https://fuchsia.googlesource.com/docs/+/master/development/workflows/package_update.md
## for more information about using this workflow.
set -e
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/lib/vars.sh
fx-config-read
function usage {
fx-command-help push-package
}
function main {
fx-standard-switches "$@"
set -- "${FX_ARGV[@]}"
# if the second arg is set, but 0-length, publish nothing
if [[ $# -eq 1 ]] && [[ -z "${1}" ]]; then
exit 0
fi
fx-command-run publish "$@"
fx-command-run push-package-no-publish "$@"
}
main "$@"