d2: update to latest master

This commit is contained in:
Dmitriy Pleshevskiy 2022-12-13 23:14:30 +03:00
parent 0469fc1fba
commit fa26d322e3
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
3 changed files with 6 additions and 31 deletions

View file

@ -4,7 +4,7 @@
, installShellFiles
}:
let version = "2022-12-12"; in
let version = "2022-12-13"; in
buildGoModule {
pname = "d2";
inherit version;
@ -12,11 +12,11 @@ buildGoModule {
src = fetchFromGitHub {
owner = "terrastruct";
repo = "d2";
rev = "a557d1a6edeb18d692c1e1c20c3c0f0cffc2ed21";
sha256 = "sha256-EzaBURGLnxSX+1FjYQLP7oxov7dGk7xhAnpV8DPzW/g=";
rev = "bf139735bf4ae782d9e855d158d27b5c34459ba1";
sha256 = "sha256-KyOaVIb8l9sewcHtHWDnhdxdFIOjzu0lejTvTs7Pa10=";
};
vendorSha256 = "sha256-p0os+ap2k5nYWI4+Hf4pwJfHTXaPJldJmf6nznhuRFA=";
vendorSha256 = "sha256-sQ8QY4A/IzlnomQETUGPwAqQDd5yyKv98DwctfJ5PSk=";
ldflags = [
"-s"
@ -26,9 +26,7 @@ buildGoModule {
nativeBuildInputs = [ installShellFiles ];
patches = [
./patches/402_preserve_leading_comment_spacing.patch
];
patches = [ ];
postInstall = "installManPage ci/release/template/man/d2.1";

View file

@ -23,7 +23,7 @@ stdenv.mkDerivation {
installPhase = ''
mkdir -p $out/bin
cp bin/d2plugin-tala $out/bin
install -Dm555 bin/d2plugin-tala $out/bin
installManPage man/d2plugin-tala.1
installManPage man/tala.1
'';

View file

@ -1,23 +0,0 @@
diff --git a/d2format/format.go b/d2format/format.go
index 754e3302..a45d55f6 100644
--- a/d2format/format.go
+++ b/d2format/format.go
@@ -76,17 +76,17 @@ func (p *printer) node(n d2ast.Node) {
p.edgeIndex(n)
}
}
func (p *printer) comment(c *d2ast.Comment) {
lines := strings.Split(c.Value, "\n")
for i, line := range lines {
p.sb.WriteString("#")
- if line != "" && !strings.HasPrefix(line, " ") {
+ if line != "" {
p.sb.WriteByte(' ')
}
p.sb.WriteString(line)
if i < len(lines)-1 {
p.newline()
}
}
}