-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
497974a
commit 5285f17
Showing
1 changed file
with
16 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
package main | ||
|
||
import "github.com/readium/go-toolkit/cmd/rwp/cmd" | ||
import ( | ||
"os" | ||
|
||
"github.com/readium/go-toolkit/cmd/rwp/cmd" | ||
) | ||
|
||
func main() { | ||
// From the archive/zip docs: | ||
// If any file inside the archive uses a non-local name | ||
// (as defined by [filepath.IsLocal]) or a name containing backslashes | ||
// and the GODEBUG environment variable contains `zipinsecurepath=0`, | ||
// NewReader returns the reader with an [ErrInsecurePath] error. | ||
if os.Getenv("GODEBUG") == "" { | ||
os.Setenv("GODEBUG", "zipinsecurepath=0") | ||
} else { | ||
os.Setenv("GODEBUG", os.Getenv("GODEBUG")+",zipinsecurepath=0") | ||
} | ||
|
||
cmd.Execute() | ||
} |