Documentation ¶
Index ¶
- func GodelPropsDistPkgInfo(projectDir string) (godelgetter.PkgSrc, error)
- func InstallVersion(projectDir, targetVersion, wantChecksum string, ...) error
- func NewInstall(dstDirPath string, srcPkg godelgetter.PkgSrc, stdout io.Writer) error
- func RunActionAndUpgradeConfig(projectDir string, skipUpgradeConfig bool, action func() error, ...) error
- func RunUpgradeConfig(projectDir string, stdout, stderr io.Writer) error
- func RunUpgradeLegacyConfig(projectDir string, stdout, stderr io.Writer) error
- func Update(projectDirPath string, srcPkg godelgetter.PkgSrc, stdout io.Writer) error
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GodelPropsDistPkgInfo ¶
func GodelPropsDistPkgInfo(projectDir string) (godelgetter.PkgSrc, error)
GodelPropsDistPkgInfo returns a package that consists of the distribution URL and checksum (if it exists) from the gödel configuration file for the gödel installation in the provided project directory.
func InstallVersion ¶
func InstallVersion(projectDir, targetVersion, wantChecksum string, cacheValidDuration time.Duration, newInstall bool, stdout io.Writer) error
InstallVersion installs the specified version of gödel in the provided project directory. If targetVersion is the empty string, the latest version is determined and used.
func NewInstall ¶
NewInstall performs a new installation of gödel in the specified directory using the specified package as the source. Calls "Install" to install the package provided as a parameter. Once the package is installed, the wrapper and settings files are copied from the newly downloaded distribution to the specified path. If there was a previous installation of gödel in the path, it is overwritten by the new file. However, changes in the "var" directory are purely additive -- files that have been added in this directory in the new distribution will be added, but existing files will not be modified or removed.
func RunActionAndUpgradeConfig ¶
func RunActionAndUpgradeConfig(projectDir string, skipUpgradeConfig bool, action func() error, stdout, stderr io.Writer) error
RunActionAndUpgradeConfig determines the gödel version of the project before the action, performs the action, determines the version after the action and runs the "upgrade-config" task depending on the version before and after the action.
If the major version after the action is <2, then no action is performed (version 2 is the first version that supports configuration upgrades).
If the major version after the action is >=2 and the major version before the action was <2, then "upgrade-config" is called with the "--legacy" flag set.
If the major version before and after the action are both >=2, then the "upgrade-config" task is run if the version after the action is >= the version before the action.
If the skipUpgradeConfig variable is true, then the provided action is run without any extra work.
func RunUpgradeConfig ¶
RunUpgradeConfig runs the "upgrade-config" task by invoking "{{projectDir}}/godelw upgrade-config".
func RunUpgradeLegacyConfig ¶
RunUpgradeLegacyConfig runs the "upgrade-config" task in legacy mode by invoking "{{projectDir}}/godelw upgrade-config --legacy".
func Update ¶
Update updates the gödel installation in the specified directory to be the distribution specified by the provided package source. Once the package is installed, the existing wrapper script and its directory are overwritten with the files provided by the package that was downloaded. However, changes in the "godel" directory are purely additive -- files that have been added in this directory in the new distribution will be added, but existing files will not be modified or removed.