Skip to content

Commit

Permalink
fix: Change current directory as a workaround to tilesetRoot bug
Browse files Browse the repository at this point in the history
  • Loading branch information
munshkr committed Oct 21, 2022
1 parent 00590f6 commit a5815df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cesiumts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"io"
"net/http"
"os"
"path"

"github.com/aws/aws-lambda-go/lambda"
"github.com/awslabs/aws-lambda-go-api-proxy/httpadapter"
Expand All @@ -23,6 +24,12 @@ func main() {
tilesetRoot := getEnv("TILESET_ROOT", ".")
baseTerrainUrl := getEnv("BASE_TERRAIN_URL", "/tilesets")

// Workaround to tilesetRoot not being current working directory: Change CWD to tilesetRoot.
err := os.Chdir(path.Join(tilesetRoot))
if err != nil {
panic(err)
}

store := fs.New(tilesetRoot)

r := mux.NewRouter()
Expand Down

0 comments on commit a5815df

Please sign in to comment.