summaryrefslogtreecommitdiffstats
path: root/cmd/embedded_stub.go
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2020-02-01 23:17:44 -0300
committerGitHub <noreply@github.com>2020-02-02 10:17:44 +0800
commitbcb52aef09160c1057baa97b9275e8fb63587b12 (patch)
tree30aa80530dc41a0a742a2eac87dd2141b4cfe621 /cmd/embedded_stub.go
parent9b9dd19d7dfe826789f0690f84d9f59470ad9e82 (diff)
downloadgitea-bcb52aef09160c1057baa97b9275e8fb63587b12.tar.gz
gitea-bcb52aef09160c1057baa97b9275e8fb63587b12.zip
Implement "embedded" command to extract static resources (#9982)
* draft * Implement extract command * Fix nits and force args on extract * Add !bindata stub, support Windows, fmt * fix vendored flag * Remove leading slash for matching * Add docs * Fix typos * Add embedded view command Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'cmd/embedded_stub.go')
-rw-r--r--cmd/embedded_stub.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/cmd/embedded_stub.go b/cmd/embedded_stub.go
new file mode 100644
index 0000000000..1f9af7b86b
--- /dev/null
+++ b/cmd/embedded_stub.go
@@ -0,0 +1,30 @@
+// Copyright 2020 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+// +build !bindata
+
+package cmd
+
+import (
+ "fmt"
+ "os"
+
+ "github.com/urfave/cli"
+)
+
+// Cmdembedded represents the available extract sub-command.
+var (
+ Cmdembedded = cli.Command{
+ Name: "embedded",
+ Usage: "Extract embedded resources",
+ Description: "A command for extracting embedded resources, like templates and images",
+ Action: extractorNotImplemented,
+ }
+)
+
+func extractorNotImplemented(c *cli.Context) error {
+ err := fmt.Errorf("Sorry: the 'embedded' subcommand is not available in builds without bindata")
+ fmt.Fprintf(os.Stderr, "%s\n", err)
+ return err
+}