Changeset 92 in code


Ignore:
Timestamp:
Jun 29, 2025, 1:51:57 AM (2 months ago)
Author:
Izuru Yakumo
Message:

Forbid the serve command to work on a non-existent directory

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r91 r92  
    77DATE ?= `date -u +%F`
    88GOOS ?= `${GO} env GOOS`
    9 VERSION ?= 1.0G+${REV}
     9VERSION ?= 1.0H+${REV}
    1010REV ?= `svn info --show-item revision || git rev-list --all | wc -l`
    1111build:
  • trunk/cmd/aya/buildall.go

    r88 r92  
    3939                                        modified = true
    4040                                }
    41                                 fmt.Println("GEN", path)
     41                                fmt.Println(path)
    4242                                return build(path, nil, vars)
    4343                        }
  • trunk/cmd/aya/main.go

    r89 r92  
    5151                aya.PrintUsage()
    5252        case "serve":
    53                 aya.HttpServe(PUBDIR, 8000)
     53                d, err := os.Stat(PUBDIR)
     54                if err != nil {
     55                        log.Fatal("[aya.HttpServe] I see, you want me to serve a non-existent directory, huh?")
     56                } else {
     57                        aya.HttpServe(fmt.Sprint(d), 8000)
     58                }
    5459        case "var":
    5560                if len(args) == 0 {
Note: See TracChangeset for help on using the changeset viewer.