tmedwards / tweego

Tweego is a free (gratis and libre) command line compiler for Twine/Twee story formats, written in Go.
https://www.motoslave.net/tweego
BSD 2-Clause "Simplified" License
129 stars 22 forks source link

tweego -w fails with "panic: runtime error: index out of range [1] with length 1" #7

Closed selden closed 4 years ago

selden commented 4 years ago

Problem:

(Low priority?) When a watched file is renamed (changing the filename but preserving the filetype) in a watched directory while developing a story, tweego crashes with the error message

panic: runtime error: index out of range [1] with length 1

goroutine 10 [running]:
main.watchFilesystem.func1(0x1dcd6500, 0xc000004360, 0xc0000a4080)
        C:/devel/local/src/tweego/filesystem.go:139 +0x634
created by main.watchFilesystem
        C:/devel/local/src/tweego/filesystem.go:115 +0x105

I'm using tweego, version 2.1.0+9ea2fab (2019-12-23T21:17:51Z) [windows/amd64] and SugarCube (v2.30.0) under Windows 10 1909, invoked using this Cygwin bash script:

#! /usr/bin/sh -x
# automatically update published web page when source file is updated
# runs tweego and gets story-formats from /usr/local/bin

tweego -w $1 -o $1.html

where the argument $1 is the name of the directory being watched. s.

tmedwards commented 4 years ago

Yep. The API on the watcher module changed, for the better, without my noticing it. Sorry about that.

It'll be fixed in the next release.