diff --git a/revel/new.go b/revel/new.go
index 4b91bd6..96e4fdd 100644
--- a/revel/new.go
+++ b/revel/new.go
@@ -205,7 +205,7 @@ func setApplicationPath(c *model.CommandConfig) (err error) {
// Set the skeleton path
func setSkeletonPath(c *model.CommandConfig) (err error) {
if len(c.New.SkeletonPath) == 0 {
- c.New.SkeletonPath = RevelCmdImportPath + ":skeleton"
+ c.New.SkeletonPath = "git://" + RevelSkeletonsImportPath + ":basic/bootstrap4"
}
// First check to see the protocol of the string
@@ -218,12 +218,13 @@ func setSkeletonPath(c *model.CommandConfig) (err error) {
if err := newLoadFromGit(c, sp); err != nil {
return err
}
- case "":
- if err := newLoadFromGo(c, sp); err != nil {
- return err
- }
+ //case "":
+
+ //if err := newLoadFromGo(c, sp); err != nil {
+ // return err
+ //}
default:
- utils.Logger.Fatal("Unsupported")
+ utils.Logger.Fatal("Unsupported skeleton schema ", "path", c.New.SkeletonPath)
}
// TODO check to see if the path needs to be extracted
@@ -259,30 +260,6 @@ func newLoadFromGit(c *model.CommandConfig, sp *url.URL) (err error) {
return
}
-// Load from GO
-func newLoadFromGo(c *model.CommandConfig, sp *url.URL) (err error) {
- // Find the source paths, download packages automatically
- pathpart := strings.Split(sp.Path, ":")
- _, skeletonImportPath , err := utils.FindSrcPaths(c.ImportPath,sp.Host+pathpart[0],c.PackageResolver)
- if err!=nil {
- return
- }
-
- skeletonImportPath = filepath.Join(skeletonImportPath,sp.Host,pathpart[0])
- // Add in anything after the "Root" path
- if len(pathpart) > 1 {
- pathpart[0] = skeletonImportPath
- newdir, _ := filepath.Abs(filepath.Join(pathpart...))
- if !strings.HasPrefix(newdir, skeletonImportPath) {
- utils.Logger.Fatal("Unusual target path outside root path", "target", newdir, "root", skeletonImportPath)
- }
- skeletonImportPath = newdir
- }
-
- c.New.SkeletonPath = skeletonImportPath
- return
-}
-
func copyNewAppFiles(c *model.CommandConfig) (err error) {
err = os.MkdirAll(c.AppPath, 0777)
if err != nil {
diff --git a/revel/new_test.go b/revel/new_test.go
index 7eeec79..c1d3bca 100644
--- a/revel/new_test.go
+++ b/revel/new_test.go
@@ -36,19 +36,13 @@ func TestNew(t *testing.T) {
t.Run("Skeleton-Git", func(t *testing.T) {
a := assert.New(t)
c := newApp("new/test/c/1", model.NEW, nil, a)
- c.New.SkeletonPath = "git://github.com/revel/cmd:skeleton2"
+ c.New.SkeletonPath = "git://github.com/revel/skeletons:basicnsadnsak"
a.NotNil(main.Commands[model.NEW].RunWith(c), "Expected Failed to run with new")
// We need to pick a different path
c = newApp("new/test/c/2", model.NEW, nil, a)
- c.New.SkeletonPath = "git://github.com/revel/cmd:skeleton"
+ c.New.SkeletonPath = "git://github.com/revel/skeletons:basic/bootstrap4"
a.Nil(main.Commands[model.NEW].RunWith(c), "Failed to run with new skeleton git")
})
- t.Run("Skeleton-Go", func(t *testing.T) {
- a := assert.New(t)
- c := newApp("new/test/d", model.NEW, nil, a)
- c.New.SkeletonPath = "github.com/revel/cmd:skeleton"
- a.Nil(main.Commands[model.NEW].RunWith(c), "Failed to run with new from go")
- })
if !t.Failed() {
if err := os.RemoveAll(gopath); err != nil {
a.Fail("Failed to remove test path")
diff --git a/revel/revel.go b/revel/revel.go
index d7bff11..ab15574 100644
--- a/revel/revel.go
+++ b/revel/revel.go
@@ -26,6 +26,9 @@ const (
// RevelCmdImportPath Revel framework cmd tool import path
RevelCmdImportPath = "github.com/revel/cmd"
+ // RevelCmdImportPath Revel framework cmd tool import path
+ RevelSkeletonsImportPath = "github.com/revel/skeletons"
+
// DefaultRunMode for revel's application
DefaultRunMode = "dev"
)
diff --git a/skeleton/.gitignore b/skeleton/.gitignore
deleted file mode 100644
index dae67d0..0000000
--- a/skeleton/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-test-results/
-tmp/
-routes/
diff --git a/skeleton/README.md b/skeleton/README.md
deleted file mode 100644
index d418163..0000000
--- a/skeleton/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Welcome to Revel
-
-A high-productivity web framework for the [Go language](http://www.golang.org/).
-
-
-### Start the web server:
-
- revel run myapp
-
-### Go to http://localhost:9000/ and you'll see:
-
- "It works"
-
-## Code Layout
-
-The directory structure of a generated Revel application:
-
- conf/ Configuration directory
- app.conf Main app configuration file
- routes Routes definition file
-
- app/ App sources
- init.go Interceptor registration
- controllers/ App controllers go here
- views/ Templates directory
-
- messages/ Message files
-
- public/ Public static assets
- css/ CSS files
- js/ Javascript files
- images/ Image files
-
- tests/ Test suites
-
-
-## Help
-
-* The [Getting Started with Revel](http://revel.github.io/tutorial/gettingstarted.html).
-* The [Revel guides](http://revel.github.io/manual/index.html).
-* The [Revel sample apps](http://revel.github.io/examples/index.html).
-* The [API documentation](https://godoc.org/github.com/revel/revel).
-
diff --git a/skeleton/app/controllers/app.go b/skeleton/app/controllers/app.go
deleted file mode 100644
index 1e94062..0000000
--- a/skeleton/app/controllers/app.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package controllers
-
-import (
- "github.com/revel/revel"
-)
-
-type App struct {
- *revel.Controller
-}
-
-func (c App) Index() revel.Result {
- return c.Render()
-}
diff --git a/skeleton/app/init.go b/skeleton/app/init.go
deleted file mode 100644
index 117dd4e..0000000
--- a/skeleton/app/init.go
+++ /dev/null
@@ -1,59 +0,0 @@
-package app
-
-import (
- "github.com/revel/revel"
-)
-
-var (
- // AppVersion revel app version (ldflags)
- AppVersion string
-
- // BuildTime revel app build-time (ldflags)
- BuildTime string
-)
-
-func init() {
- // Filters is the default set of global filters.
- revel.Filters = []revel.Filter{
- revel.PanicFilter, // Recover from panics and display an error page instead.
- revel.RouterFilter, // Use the routing table to select the right Action
- revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
- revel.ParamsFilter, // Parse parameters into Controller.Params.
- revel.SessionFilter, // Restore and write the session cookie.
- revel.FlashFilter, // Restore and write the flash cookie.
- revel.ValidationFilter, // Restore kept validation errors and save new ones from cookie.
- revel.I18nFilter, // Resolve the requested language
- HeaderFilter, // Add some security based headers
- revel.InterceptorFilter, // Run interceptors around the action.
- revel.CompressFilter, // Compress the result.
- revel.BeforeAfterFilter, // Call the before and after filter functions
- revel.ActionInvoker, // Invoke the action.
- }
-
- // Register startup functions with OnAppStart
- // revel.DevMode and revel.RunMode only work inside of OnAppStart. See Example Startup Script
- // ( order dependent )
- // revel.OnAppStart(ExampleStartupScript)
- // revel.OnAppStart(InitDB)
- // revel.OnAppStart(FillCache)
-}
-
-// HeaderFilter adds common security headers
-// There is a full implementation of a CSRF filter in
-// https://github.com/revel/modules/tree/master/csrf
-var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) {
- c.Response.Out.Header().Add("X-Frame-Options", "SAMEORIGIN")
- c.Response.Out.Header().Add("X-XSS-Protection", "1; mode=block")
- c.Response.Out.Header().Add("X-Content-Type-Options", "nosniff")
- c.Response.Out.Header().Add("Referrer-Policy", "strict-origin-when-cross-origin")
-
- fc[0](c, fc[1:]) // Execute the next filter stage.
-}
-
-//func ExampleStartupScript() {
-// // revel.DevMod and revel.RunMode work here
-// // Use this script to check for dev mode and set dev/prod startup scripts here!
-// if revel.DevMode == true {
-// // Dev mode
-// }
-//}
diff --git a/skeleton/app/views/App/Index.html b/skeleton/app/views/App/Index.html
deleted file mode 100644
index abfa102..0000000
--- a/skeleton/app/views/App/Index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-{{set . "title" "Home"}}
-{{template "header.html" .}}
-
-It works!
-
-
- {{.Description}} -
- {{end}} -{{end}} - - diff --git a/skeleton/app/views/errors/500.html b/skeleton/app/views/errors/500.html deleted file mode 100644 index 0cef4de..0000000 --- a/skeleton/app/views/errors/500.html +++ /dev/null @@ -1,16 +0,0 @@ - - - -- This exception has been logged. -
- {{end}} - - diff --git a/skeleton/app/views/flash.html b/skeleton/app/views/flash.html deleted file mode 100644 index 1c764c0..0000000 --- a/skeleton/app/views/flash.html +++ /dev/null @@ -1,18 +0,0 @@ -{{if .flash.success}} -