shaoshing / train

Asset Management for web app using Golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Production mode path issues

escholtz opened this issue · comments

I recently upgraded train to latest from a version that was at least a few months old. After the upgrade, javascript_tag and stylesheet_tag helpers appeared to be broken in production mode. Not sure if this is an issue with train or the way I am using train.

I was able to fix my issues by changing flag.StringVar(&outPath, "out", "./public", "") in cmd.go to flag.StringVar(&outPath, "out", "public", ""). I think the ./ prefix was causing the strings.Replace calls in WriteToManifest to fail. Is this a bug with train or do you think there's something wrong with my local setup?

As a 2nd request, would you consider changing HasPublicAssets() to look for public/assets/manifest.txt instead of public/assets/? This would be useful because I'm storing other files in public/assets besides the files that train generates so I don't delete the entire folder when switching between development/production modes.

Thanks for your help and building this package. Keep up the good work!

I have the same issue with production paths after upgrading to the latest version

commented

Hello, I am facing the same issue. Any plans to fix this? I can send a PR for it.