-
-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add autocomplete command build * Add bash completion to install_ddev.sh * Add minor doc for using autocomplete * Generate bash completion in circle and add to tarballs * Satisfy the static analysis gods * Consolidate artifacts-generation in a script
- Loading branch information
Showing
5 changed files
with
71 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
ARTIFACTS=$1 | ||
BASE_DIR=$PWD | ||
|
||
sudo mkdir $ARTIFACTS && sudo chmod 777 $ARTIFACTS | ||
export VERSION=$(git describe --tags --always --dirty) | ||
|
||
# Generate and place the autocomplete | ||
bin/linux/ddev_gen_autocomplete | ||
for dir in bin/darwin/darwin_amd64 bin/linux bin/windows/windows_amd64; do | ||
cp bin/ddev_bash_completion.sh $dir | ||
done | ||
|
||
# Generate OSX tarball/zipball | ||
cd $BASE_DIR/bin/darwin/darwin_amd64 | ||
tar -czf $ARTIFACTS/ddev_osx.$VERSION.tar.gz ddev ddev_bash_completion.sh | ||
zip $ARTIFACTS/ddev_osx.$VERSION.zip ddev ddev_bash_completion.sh | ||
|
||
# Generate linux tarball/zipball | ||
cd $BASE_DIR/bin/linux | ||
tar -czf $ARTIFACTS/ddev_linux.$VERSION.tar.gz ddev ddev_bash_completion.sh | ||
zip $ARTIFACTS/ddev_linux.$VERSION.zip ddev ddev_bash_completion.sh | ||
|
||
# generate windows tarball/zipball | ||
cd $BASE_DIR/bin/windows/windows_amd64 | ||
tar -czf $ARTIFACTS/ddev_windows.$VERSION.tar.gz ddev.exe ddev_bash_completion.sh | ||
zip $ARTIFACTS/ddev_windows.$VERSION.zip ddev.exe ddev_bash_completion.sh | ||
|
||
# Create the sha256 files | ||
cd $ARTIFACTS | ||
for item in *.tar.gz *.zip; do | ||
sha256sum $item > $item.sha256.txt | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/drud/ddev/cmd/ddev/cmd" | ||
"github.com/drud/ddev/pkg/util" | ||
) | ||
|
||
var targetDir = "bin" | ||
|
||
func main() { | ||
if _, err := os.Stat(targetDir); os.IsNotExist(err) { | ||
err = os.MkdirAll(targetDir, 0755) | ||
util.CheckErr(err) | ||
} | ||
err := cmd.RootCmd.GenBashCompletionFile(filepath.Join(targetDir, "ddev_bash_completion.sh")) | ||
util.CheckErr(err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters