1
0
mirror of https://github.com/beego/bee.git synced 2025-07-05 18:20:18 +00:00

Working on bee bale

This commit is contained in:
Unknown
2013-09-03 13:23:58 -04:00
parent b30217c1d3
commit e606b0045d
11 changed files with 198 additions and 13 deletions

29
run.go
View File

@ -1,3 +1,17 @@
// Copyright 2013 bee authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package main
import (
@ -61,10 +75,11 @@ var conf struct {
Others []string // Other directories.
} `json:"dir_structure"`
MainFiles struct {
Main string `json:"main.go"`
Others []string // Others files of package main.
} `json:"main_files"`
Bale struct {
Import string
Dirs []string
IngExt []string `json:"ignore_ext"`
}
}
func runApp(cmd *Command, args []string) {
@ -79,7 +94,7 @@ func runApp(cmd *Command, args []string) {
err := loadConfig()
if err != nil {
com.ColorLog("[ERRO] Fail to parse bee.json[ %s ]", err)
com.ColorLog("[ERRO] Fail to parse bee.json[ %s ]\n", err)
}
var paths []string
paths = append(paths,
@ -89,7 +104,6 @@ func runApp(cmd *Command, args []string) {
// Because monitor files has some issues, we watch current directory
// and ignore non-go files.
paths = append(paths, conf.DirStruct.Others...)
paths = append(paths, conf.MainFiles.Others...)
NewWatcher(paths)
appname = args[0]
@ -127,8 +141,5 @@ func loadConfig() error {
if len(conf.DirStruct.Models) == 0 {
conf.DirStruct.Models = "models"
}
if len(conf.MainFiles.Main) == 0 {
conf.MainFiles.Main = "main.go"
}
return nil
}