From a17b54527aaca20fb155aa00cc71d83200e95829 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 25 Jan 2024 21:46:12 +0200 Subject: [PATCH] examples: allow for `./v run examples/xvweb/todo`, without needing to first change the current folder to examples/xvweb/ --- examples/xvweb/todo/main.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/xvweb/todo/main.v b/examples/xvweb/todo/main.v index 43a903d42a..1f4431fa8d 100644 --- a/examples/xvweb/todo/main.v +++ b/examples/xvweb/todo/main.v @@ -6,6 +6,7 @@ module main import x.vweb import db.sqlite +import os import time struct Todo { @@ -125,6 +126,7 @@ pub fn (app &App) delete_todo(mut ctx Context, id int) vweb.Result { } fn main() { + os.chdir(os.dir(@FILE))! // create a new App instance with a connection to the datbase mut app := &App{ db: sqlite.connect('todo.db')!