Comments (2)
Does this also happen if you write this same script in e.g. bash?
from dax.
No, the problem seems to be related to Deno.execPath()
This works (using Deno.Command behind the scenes, and ["deno", "--version"]
as command):
import { Cron } from "jsr:@hexagon/croner";
import { spawn } from "jsr:@cross/utils";
// Check deno version every fifth second
new Cron("*/10 * * * * *", async () => {
try {
const result = await spawn(["deno","--version"]);
console.log("Success!");
console.log(result);
} catch (e) {
console.error("Failure!");
console.log(e);
}
});
... but this gives the said error (using [Deno.execPath(), "--version"]
as command);
import { Cron } from "jsr:@hexagon/croner";
import { spawn } from "jsr:@cross/utils";
// Check deno version every fifth second
new Cron("*/10 * * * * *", async () => {
try {
const result = await spawn([Deno.execPath(),"--version"]);
console.log("Success!");
console.log(result);
} catch (e) {
console.error("Failure!");
console.log(e);
}
});
Could it be that dax uses Deno.execPath()
internally, and Deno.execPath()
somehow get changed to /home/user/.deno/bin/deno (deleted)
when deno is upgraded?
Edit: Yep, just removing (deleted)
from Deno.execPath() resolves the problem in my example. This works [Deno.execPath().replace(" (deleted)",""),"--version"]
.
from dax.
Related Issues (20)
- Panic on stderr redirect
- Make it easier to pipe to files HOT 3
- Patch for deprecation warnings in console/utils.ts HOT 2
- Redesign command and internal streams
- Ability to cancel a request HOT 1
- Support for subshells breaks escaped parentheses HOT 1
- Rename `PathRef` to `Path`
- Support providing a `CommandBuilder` to a template literal expr HOT 1
- built-in 'cat' command does not work with absolute paths
- Add `.linesIter()`
- Support glob expansion
- Path - Copy dir recursive
- Strict typing for arguments HOT 1
- $.prompt doesn't support utf-8? HOT 1
- add command for `tar` HOT 2
- imagemagick hangs 😞
- Windows style path is not treated as a valid command.
- Path - `lines()`/`linesSync()` and `.linesIter()`/`linesIterSync()`
- `deno compile` into executable with `dax`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dax.