blob: 93853ba8515778d26195d644c6607d8c1be7cdec [file] [log] [blame]
#!/bin/bash
# Copyright 2018 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.
#### CATEGORY=Build
### set the default build directory used by other fx commands
## usage: fx set-build-dir DIR
## or: fx --dir DIR set-build-dir
## or: fx set-buil-dir
##
## Switches further `fx` commands to using a different build directory.
## This only works if `fx --dir DIR set ...` succeeded previously
## (and DIR has not been removed since). The next `fx build` or other
## such command will now refer to DIR. The previous build directory is
## left in place, so you can switch back again with `fx set-build-dir` later.
##
## fx set-build-dir without arguments will list the available build directories, naming
## the current active build directory (if any).
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
fx-command-run use "$@"