@@ -30,6 +30,8 @@ import (
3030 "gopkg.in/urfave/cli.v1"
3131)
3232
33+ const bzzManifestJSON = "application/bzz-manifest+json"
34+
3335func add (ctx * cli.Context ) {
3436 args := ctx .Args ()
3537 if len (args ) < 3 {
@@ -145,7 +147,7 @@ func addEntryToManifest(ctx *cli.Context, mhash, path, hash, ctype string) strin
145147 if path == entry .Path {
146148 utils .Fatalf ("Path %s already present, not adding anything" , path )
147149 } else {
148- if entry .ContentType == "application/bzz-manifest+json" {
150+ if entry .ContentType == bzzManifestJSON {
149151 prfxlen := strings .HasPrefix (path , entry .Path )
150152 if prfxlen && len (path ) > len (longestPathEntry .Path ) {
151153 longestPathEntry = entry
@@ -207,7 +209,7 @@ func updateEntryInManifest(ctx *cli.Context, mhash, path, hash, ctype string) st
207209 if path == entry .Path {
208210 newEntry = entry
209211 } else {
210- if entry .ContentType == "application/bzz-manifest+json" {
212+ if entry .ContentType == bzzManifestJSON {
211213 prfxlen := strings .HasPrefix (path , entry .Path )
212214 if prfxlen && len (path ) > len (longestPathEntry .Path ) {
213215 longestPathEntry = entry
@@ -281,7 +283,7 @@ func removeEntryFromManifest(ctx *cli.Context, mhash, path string) string {
281283 if path == entry .Path {
282284 entryToRemove = entry
283285 } else {
284- if entry .ContentType == "application/bzz-manifest+json" {
286+ if entry .ContentType == bzzManifestJSON {
285287 prfxlen := strings .HasPrefix (path , entry .Path )
286288 if prfxlen && len (path ) > len (longestPathEntry .Path ) {
287289 longestPathEntry = entry
0 commit comments