Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folder produces inconsistent results #12

Closed
tobiashienzsch opened this issue Jan 17, 2019 · 2 comments
Closed

Folder produces inconsistent results #12

tobiashienzsch opened this issue Jan 17, 2019 · 2 comments
Labels
s: fixed was fixed or solution offered

Comments

@tobiashienzsch
Copy link

Description

v0.14.0-beta.2

When using an underscore in the name of a resource the generator creates a wrong directory structure inside of templates/.

Steps to Reproduce the Problem character

  1. buffalo generate resource electronic_store name web

Expected Behavior

├── electronic_stores
│       ├── edit.html
│       ├── _form.html
│       ├── index.html
│       ├── new.html
│       └── show.html

Actual Behavior

├── electronic
│   └── stores
│       ├── edit.html
│       ├── _form.html
│       ├── index.html
│       ├── new.html
│       └── show.html

Info

### Buffalo Version
v0.14.0-beta.2

### App Information
Pwd=/home/tobante/go/src/github.com/tobiashienzsch/shoppinger_data_manager
Root=/home/tobante/go/src/github.com/tobiashienzsch/shoppinger_data_manager
GoPath=/home/tobante/go
PackagePkg=github.com/tobiashienzsch/shoppinger_data_manager
ActionsPkg=github.com/tobiashienzsch/shoppinger_data_manager/actions
ModelsPkg=github.com/tobiashienzsch/shoppinger_data_manager/models
GriftsPkg=github.com/tobiashienzsch/shoppinger_data_manager/grifts
WithModules=true
Name=shoppinger-data-manager
Bin=bin/shoppinger-data-manager
VCS=git
WithPop=true
WithSQLite=false
WithDep=false
WithWebpack=true
WithNodeJs=false
WithYarn=true
WithDocker=false
WithGrifts=false
AsWeb=true
AsAPI=false

### Go Version
go version go1.11.4 linux/amd64

### Go Env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tobante/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tobante/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/tobante/go/src/github.com/tobiashienzsch/shoppinger_data_manager/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build032577947=/tmp/go-build -gno-record-gcc-switches"

### Node Version
v10.15.0

### NPM Version
6.4.1

### Yarn Version
1.12.3

### PostgreSQL Version
PostgreSQL Not Found

### MySQL Version
MySQL Not Found

### SQLite Version
3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt1

### Dep Version
could not find a Gopkg.toml file

### Dep Status
could not find a Gopkg.toml file

### go.mod
module github.com/tobiashienzsch/shoppinger_data_manager

require (
        github.com/codegangsta/negroni v1.0.0 // indirect
        github.com/gobuffalo/buffalo v0.14.0-beta.2
        github.com/gobuffalo/buffalo-pop v1.4.0
        github.com/gobuffalo/envy v1.6.11
        github.com/gobuffalo/makr v1.1.5 // indirect
        github.com/gobuffalo/mw-csrf v0.0.0-20180802151833-446ff26e108b
        github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130
        github.com/gobuffalo/mw-i18n v0.0.0-20181027200759-09e0c99be4d3
        github.com/gobuffalo/mw-paramlogger v0.0.0-20181005191442-d6ee392ec72e
        github.com/gobuffalo/packr v1.21.9
        github.com/gobuffalo/packr/v2 v2.0.0-rc.14
        github.com/gobuffalo/pop v4.9.4+incompatible
        github.com/gobuffalo/suite v2.6.0+incompatible
        github.com/gobuffalo/uuid v2.0.5+incompatible
        github.com/gobuffalo/validate v2.0.3+incompatible
        github.com/jackc/pgx v3.3.0+incompatible // indirect
        github.com/jmoiron/sqlx v1.2.0 // indirect
        github.com/markbates/grift v1.0.5
        github.com/pkg/errors v0.8.1
        github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c
)
@tobiashienzsch
Copy link
Author

tobiashienzsch commented Jan 17, 2019

Little update:

I looked around the source a little, the problem seems to be in github.com/gobuffalo/buffalo/genny/resource/resource.go . On line 49:

folder := pres.Name.Folder().Pluralize().String()

prints electronic/stores it should be electronic_stores

@markbates markbates transferred this issue from gobuffalo/buffalo Jan 17, 2019
@markbates markbates changed the title Generator can't handle underscore "_" character in resource name (v0.14.0-beta.2) Folder produces inconsistent results Jan 17, 2019
@sio4 sio4 added the s: fixed was fixed or solution offered label Sep 3, 2022
@sio4
Copy link
Member

sio4 commented Sep 3, 2022

related to #60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: fixed was fixed or solution offered
Projects
None yet
Development

No branches or pull requests

2 participants