Debian Codegraph @

debian/patches/0002-Disable-static-files-for-present-cmd.patch

raw
1 From: =?utf-8?q?Mart=C3=ADn_Ferrari?= <[email protected]>
2 Date: Tue, 17 Nov 2020 02:14:58 +0800
3 Subject: Disable static files for present cmd
4
5 This path is debian-specific, hence this patch cannot go upstream.
6
7 Forwarded: not-needed
8 ---
9 cmd/present/main.go | 6 +-----
10 1 file changed, 1 insertion(+), 5 deletions(-)
11
12 diff --git a/cmd/present/main.go b/cmd/present/main.go
13 index 6c7a40c..58ac528 100644
14 --- a/cmd/present/main.go
15 +++ b/cmd/present/main.go
16 @@ -5,7 +5,6 @@
17 package main
18
19 import (
20 - "embed"
21 "flag"
22 "fmt"
23 "io/fs"
24 @@ -27,9 +26,6 @@ var (
25 usePlayground = flag.Bool("use_playground", false, "run code snippets using play.golang.org; if false, run them locally and deliver results by WebSocket transport")
26 )
27
28 -//go:embed static templates
29 -var embedFS embed.FS
30 -
31 func main() {
32 flag.BoolVar(&present.PlayEnabled, "play", true, "enable playground (permit execution of arbitrary user code)")
33 flag.BoolVar(&present.NotesEnabled, "notes", false, "enable presenter notes (press 'N' from the browser to display them)")
34 @@ -51,7 +47,7 @@ func main() {
35 *contentPath = "./content/"
36 }
37
38 - var fsys fs.FS = embedFS
39 + var fsys fs.FS = os.DirFS("/usr/share/golang-golang-x-tools/present")
40 if *basePath != "" {
41 fsys = os.DirFS(*basePath)
42 }