d2: Move cmd to repo root

Closes #113
This commit is contained in:
Anmol Sethi 2022-11-30 21:14:38 -08:00
parent 5fa80861ff
commit c55bf62438
No known key found for this signature in database
GPG key ID: 25BC68888A99A8BA
13 changed files with 11 additions and 7 deletions

View file

@ -14,7 +14,7 @@ export GOOS=$(goos "$OS")
export GOARCH="$ARCH" export GOARCH="$ARCH"
sh_c mkdir -p "$HW_BUILD_DIR/bin" sh_c mkdir -p "$HW_BUILD_DIR/bin"
sh_c go build -ldflags "'-X oss.terrastruct.com/d2/lib/version.Version=$VERSION'" \ sh_c go build -ldflags "'-X oss.terrastruct.com/d2/lib/version.Version=$VERSION'" \
-o "$HW_BUILD_DIR/bin/d2" ./cmd/d2 -o "$HW_BUILD_DIR/bin/d2" .
ARCHIVE=$PWD/$ARCHIVE ARCHIVE=$PWD/$ARCHIVE
cd "$(dirname "$HW_BUILD_DIR")" cd "$(dirname "$HW_BUILD_DIR")"

View file

@ -23,6 +23,10 @@
[#251](https://github.com/terrastruct/d2/pull/251) [#251](https://github.com/terrastruct/d2/pull/251)
- [install.sh](./install.sh) prints the dry run message more visibly. - [install.sh](./install.sh) prints the dry run message more visibly.
[#266](https://github.com/terrastruct/d2/pull/266) [#266](https://github.com/terrastruct/d2/pull/266)
- `d2` now lives in the root folder of the repository instead of as a subcommand.
So you can run `go install oss.terrastruct.com/d2@latest` to install from source
now.
[#xxx](https://github.com/terrastruct/d2/pull/xxx)
#### Bugfixes 🔴 #### Bugfixes 🔴

View file

@ -1,6 +1,6 @@
//go:build cgo //go:build cgo
package d2 package d2lib
import "oss.terrastruct.com/d2/d2layouts/d2dagrelayout" import "oss.terrastruct.com/d2/d2layouts/d2dagrelayout"

View file

@ -1,4 +1,4 @@
package d2 package d2lib
import ( import (
"context" "context"

View file

@ -83,7 +83,7 @@ know where the release directory is for easy uninstall.
You can always install from source: You can always install from source:
```sh ```sh
go install oss.terrastruct.com/d2/cmd/d2@latest go install oss.terrastruct.com/d2@latest
``` ```
## Coming soon ## Coming soon

View file

@ -16,10 +16,10 @@ import (
"oss.terrastruct.com/diff" "oss.terrastruct.com/diff"
"oss.terrastruct.com/d2"
"oss.terrastruct.com/d2/d2graph" "oss.terrastruct.com/d2/d2graph"
"oss.terrastruct.com/d2/d2layouts/d2dagrelayout" "oss.terrastruct.com/d2/d2layouts/d2dagrelayout"
"oss.terrastruct.com/d2/d2layouts/d2elklayout" "oss.terrastruct.com/d2/d2layouts/d2elklayout"
d2 "oss.terrastruct.com/d2/d2lib"
"oss.terrastruct.com/d2/d2renderers/d2svg" "oss.terrastruct.com/d2/d2renderers/d2svg"
"oss.terrastruct.com/d2/d2renderers/textmeasure" "oss.terrastruct.com/d2/d2renderers/textmeasure"
"oss.terrastruct.com/d2/d2target" "oss.terrastruct.com/d2/d2target"

View file

@ -22,7 +22,7 @@ It defaults to file.svg if an output path is not provided.
Use - to have d2 read from stdin or write to stdout. Use - to have d2 read from stdin or write to stdout.
See man %[1]s for more detailed docs. See man d2 for more detailed docs.
Flags: Flags:
%s %s

View file

@ -14,8 +14,8 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
"go.uber.org/multierr" "go.uber.org/multierr"
"oss.terrastruct.com/d2"
"oss.terrastruct.com/d2/d2layouts/d2sequence" "oss.terrastruct.com/d2/d2layouts/d2sequence"
d2 "oss.terrastruct.com/d2/d2lib"
"oss.terrastruct.com/d2/d2plugin" "oss.terrastruct.com/d2/d2plugin"
"oss.terrastruct.com/d2/d2renderers/d2svg" "oss.terrastruct.com/d2/d2renderers/d2svg"
"oss.terrastruct.com/d2/d2renderers/textmeasure" "oss.terrastruct.com/d2/d2renderers/textmeasure"