Skip to content

Commit

Permalink
fix(cli): dev command (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuiiBz authored Oct 19, 2022
1 parent 0466dd4 commit 8c12b2b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-pigs-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lagon/cli': patch
---

Fix dev command
2 changes: 1 addition & 1 deletion packages/cli/npm/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ const getBinary = require('./getBinary');
const binary = getBinary();

// Try to install the binary before executing the CLI
binary.install().then(binary.run);
binary.install({}, true).then(() => binary.run());
5 changes: 4 additions & 1 deletion packages/cli/src/commands/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use lagon_runtime::runtime::{Runtime, RuntimeOptions};
use notify::{Config, RecommendedWatcher, RecursiveMode, Watcher};
use std::collections::HashMap;
use std::convert::Infallible;
use std::fs;
use std::path::Path;
use std::sync::Arc;
use std::time::Duration;
Expand Down Expand Up @@ -199,8 +200,10 @@ pub async fn dev(
)
.unwrap();

let path = fs::canonicalize(&file)?;

watcher
.watch(file.parent().unwrap(), RecursiveMode::Recursive)
.watch(path.parent().unwrap(), RecursiveMode::Recursive)
.unwrap();

let watcher_content = content.clone();
Expand Down

0 comments on commit 8c12b2b

Please sign in to comment.