def main(project_dir=None): """ This function is executed when you run `fbs ...` on the command line. You can call this function from your own build script to run fbs as if it were called via the above command. For an example, see: https://build-system.fman.io/manual/#custom-commands """ if project_dir is None: project_dir = getcwd() try: fbs.init(project_dir) # Load built-in commands: from fbs import builtin_commands from fbs.builtin_commands import _docker from fbs.builtin_commands import _gpg from fbs.builtin_commands import _account from fbs.builtin_commands import _licensing fn, args = _parse_cmdline() fn(*args) except KeyboardInterrupt: print('') sys.exit(-1) except FbsError as e: # Don't print a stack trace for FbsErrors, just their message: _LOG.error(str(e)) sys.exit(-1)
def main(project_dir=None): if project_dir is None: project_dir = getcwd() fbs.init(project_dir) # Load built-in commands: from fbs import builtin_commands parser = _get_cmdline_parser() args = parser.parse_args() if hasattr(args, 'cmd'): args.cmd() else: parser.print_help()
def main(project_dir=None): """ This function is executed when you run `python -m fbs ...` on the command line. You can call this function from your own build script to run fbs as if it were called via the above command. For an example, see: https://build-system.fman.io/manual/#custom-commands """ if project_dir is None: project_dir = getcwd() fbs.init(project_dir) # Load built-in commands: from fbs import builtin_commands parser = _get_cmdline_parser() args = parser.parse_args() if hasattr(args, 'cmd'): args.cmd() else: parser.print_help()
def init_fbs(self, platform_name=None): if platform_name is not None: runtime_state.restore(platform_name, None, None) fbs.init(self._project_dir)