#!/bin/bash
# dev/package/git - package git version control support

set -e

lib_load 'sys/tool/git'


######
# Library Settings

dev_package_git_config_init() {
	lib_setting_vars package_git_required
	lib_setting_vars -ro package_repodir package_objdir package_gendir

	dev_package_git_config_check
}

dev_package_git_config_check() {
	package_git_required=${package_git_required:-true}

	local repodir
	repodir=$(git_repo_dir)
	if [ -z "$repodir" ]; then
		if $package_git_required; then
			error "package commands must be run in a source tree"
		fi
		repodir=$PWD
	fi

	package_repodir=${package_repodir:-$repodir}
	package_objdir=${package_objdir:-$package_repodir/obj}
	package_gendir=${package_gendir:-$package_objdir/gen}
}

View the Developer Guide Index

View the Reference Manual Index


Generated on Tue Jul 4 17:00:37 PDT 2017 by mcsh d14 v0.21.0.