Slightly fixed path forming for mk using pathx.
This commit is contained in:
parent
c3eea5be73
commit
58d1a2f98a
5 changed files with 9 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
exe/
|
exe/
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,8 @@ install-sh:VQ: build
|
||||||
fi
|
fi
|
||||||
if test -d exe ; then
|
if test -d exe ; then
|
||||||
echo Installing executables...
|
echo Installing executables...
|
||||||
cp -rf exe $EXEDIR/..
|
mkdir -p $EXEDIR
|
||||||
|
cp -rf exe/* $EXEDIR/
|
||||||
files=`goblin basename $(ls exe)`
|
files=`goblin basename $(ls exe)`
|
||||||
for i in $files ; do
|
for i in $files ; do
|
||||||
chmod 0755 $EXEDIR/$i
|
chmod 0755 $EXEDIR/$i
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
wd=`pwd`
|
wd=`pwd`
|
||||||
|
|
||||||
cd src/cmd/goblin && go install&& cd $wd
|
cd src/cmd/goblin && go install && cd $wd
|
||||||
|
|
||||||
mkdir -p $HOME/app/goblin
|
mkdir -p $HOME/app/goblin
|
||||||
cp -rf app/* $HOME/app/goblin
|
cp -rf app/* $HOME/app/goblin
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"github.com/surdeus/goblin/src/pathx"
|
||||||
)
|
)
|
||||||
|
|
||||||
// True if messages should be printed without fancy colors.
|
// True if messages should be printed without fancy colors.
|
||||||
|
@ -344,7 +345,7 @@ func Run(args []string) {
|
||||||
flags.BoolVar(&quiet, "q", false, "don't print recipes before executing them")
|
flags.BoolVar(&quiet, "q", false, "don't print recipes before executing them")
|
||||||
flags.Parse(args)
|
flags.Parse(args)
|
||||||
|
|
||||||
mkfile, err := os.Open(mkfilepath)
|
mkfile, err := os.Open(pathx.From(mkfilepath).Real())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mkError("no mkfile found")
|
mkError("no mkfile found")
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"github.com/surdeus/goblin/src/pathx"
|
||||||
)
|
)
|
||||||
|
|
||||||
type parser struct {
|
type parser struct {
|
||||||
|
@ -164,7 +165,7 @@ func parseRedirInclude(p *parser, t token) parserStateFun {
|
||||||
for i := range p.tokenbuf {
|
for i := range p.tokenbuf {
|
||||||
filename += expand(p.tokenbuf[i].val, p.rules.vars, true)[0]
|
filename += expand(p.tokenbuf[i].val, p.rules.vars, true)[0]
|
||||||
}
|
}
|
||||||
file, err := os.Open(filename)
|
file, err := os.Open(pathx.From(filename).Real())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.basicWarnAtToken(fmt.Sprintf("cannot open %s", filename), p.tokenbuf[0])
|
p.basicWarnAtToken(fmt.Sprintf("cannot open %s", filename), p.tokenbuf[0])
|
||||||
//p.basicErrorAtToken(fmt.Sprintf("cannot open %s", filename), p.tokenbuf[0])
|
//p.basicErrorAtToken(fmt.Sprintf("cannot open %s", filename), p.tokenbuf[0])
|
||||||
|
|
Loading…
Reference in a new issue