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

abcweb new failed to copy templates on project with multiple GOPATH #13

Closed
airlanggacahya opened this issue Jul 6, 2017 · 7 comments
Closed

Comments

@airlanggacahya
Copy link

Env:
Windows 10 64bit
Go 1.8.3 64bit

Step to introduce:

  1. Install abcweb to first gopath (called go-base)
  2. Add second gopath (called cashkit)
  3. Run abcweb new

Expected:
Application generate new project

Result:
Failed with error: cannot locate base path containing templates folder

Output:
$ abcweb new gitlab.com/xxx/cashkit/
Your GOPATH has multiple paths, select your desired GOPATH:
[1] C:\Users\Airlangga\Projects\cashkit
[2] C:\Users\Airlangga\Application\go-base
Select GOPATH number: 1
1
Generating in: C:\Users\Airlangga\Projects\cashkit\src\gitlab.com\xxx\cashkit
Error: cannot locate base path containing templates folder
Usage:
abcweb new <import_path> [flags]

Examples:
abcweb new github.com/yourusername/myapp

... *cutout to reduce noise

$ echo %GOPATH%
C:\Users\Airlangga\Projects\cashkit;C:\Users\Airlangga\Application\go-base

@nullbio
Copy link
Member

nullbio commented Jul 8, 2017

I'm presuming abcweb is installed in the go-base path and not the cashkit path? I'm strongly suspecting this problem is occurring because it's looking for the templates for abcweb in cashkit when obviously they do not exist there. Let me confirm that is indeed the problem first, before proposing a solution. I'll get back to you. There will be a few possible routes we can take to solve this. Provided I'm correct about what I think is going on here a work around would be to move the abcweb install to the other gopath.

@airlanggacahya
Copy link
Author

airlanggacahya commented Jul 8, 2017 via email

@nullbio
Copy link
Member

nullbio commented Jul 14, 2017

Sorry it took so long to get back to you on this, I've been very busy with some work stuff and hadn't had a chance to test it out. A few questions:

  • What is the full path to your abcweb install?
  • Can you also show the output of go env?
  • Can you abcweb new successfully in the gopath that has the abcweb install?

I'm trying to replicate this on Linux and not having much success.

@airlanggacahya
Copy link
Author

I remove the split stuff and instead go get using the project path.

I will replay the step later after #14 is resolved. Currently it's not possible to go get abcweb.

@nullbio
Copy link
Member

nullbio commented Jul 14, 2017

Working on that right now. I've forked that repo, will be maintaining it myself moving forward. Just adding a few other changes like Chi v3 then I'll merge it into master. Will keep you posted.

@nullbio
Copy link
Member

nullbio commented Jul 14, 2017

I've released v3 which addresses the refresh library problem: https://github.com/volatiletech/abcweb/releases/tag/v3.0.0 -- you should be good to experiment now. Thank you.

@airlanggacahya
Copy link
Author

λ go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Airlangga\Applications\go-base
set GORACE=
set GOROOT=C:\Users\Airlangga\Applications\go
set GOTOOLDIR=C:\Users\Airlangga\Applications\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2

λ go get -u github.com/volatiletech/abcweb

λ abcweb --version
ABCWeb v3.0.2

λ mkdir abctest abctest\bin abctest\src abctest\pkg

λ cd abctest

λ set GOPATH=C:\Users\Airlangga\Projects\abctest;C:\Users\Airlangga\Application\go-base

λ go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Airlangga\Projects\abctest;C:\Users\Airlangga\Application\go-base
set GORACE=
set GOROOT=C:\Users\Airlangga\Applications\go
set GOTOOLDIR=C:\Users\Airlangga\Applications\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2

λ abcweb new airlangga\abctest
Your GOPATH has multiple paths, select your desired GOPATH:
[1] C:\Users\Airlangga\Projects\abctest
[2] C:\Users\Airlangga\Application\go-base
Select GOPATH number: 1
1
Generating in: C:\Users\Airlangga\Projects\abctest\src\airlangga\abctest
Error: cannot locate base path containing templates folder
Usage:
  abcweb new <import_path> [flags]

Examples:
abcweb new github.com/yourusername/myapp

Flags:
  -b, --bootstrap string              Include Twitter Bootstrap 4 (none|regular|gridonly|rebootonly|gridandrebootonly) (default "regular")
      --default-env string            Default $APP_ENV to use when starting server (default "prod")
      --force-overwrite               Force overwrite of existing files in your import_path
  -h, --help                          help for new
  -j, --no-bootstrap-js               Skip Twitter Bootstrap 4 javascript inclusion
  -c, --no-config                     Skip default config.toml file
  -f, --no-font-awesome               Skip Font Awesome inclusion
      --no-gulp                       Skip generation of gulpfile.js, package.json and installation of gulp dependencies
  -l, --no-livereload                 Don't include LiveReload support
  -r, --no-readme                     Skip README.md files
  -s, --no-sessions                   Skip support for http sessions
  -t, --no-tls-certs                  Skip generation of self-signed TLS cert files
  -d, --sessions-dev-storer string    Session storer to use in development mode (cookie|memory|disk|redis) (default "cookie")
  -p, --sessions-prod-storer string   Session storer to use in production mode (cookie|memory|disk|redis) (default "disk")
      --silent                        Disable console output
      --skip-dep-ensure               Skip running dep ensure command
      --skip-git-init                 Skip running git init command
      --skip-npm-install              Skip running npm install command
      --tls-common-name string        Common Name for generated TLS certificate (default "localhost")
  -v, --verbose                       Show verbose output for npm install and dep ensure

Here is the full workflow. But it's working correctly if using single GOPATH.

@nullbio nullbio closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants