Skip to content

Commit

Permalink
fix(sdk): fix requirements loading (#1231)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard authored Oct 27, 2023
1 parent b0675da commit 871ff87
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
57 changes: 30 additions & 27 deletions components/clarinet-sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/clarinet-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hirosystems/clarinet-sdk",
"version": "1.0.3",
"version": "1.0.4",
"description": "A SDK to interact with Clarity Smart Contracts",
"homepage": "https://docs.hiro.so/clarinet/feature-guides/clarinet-js-sdk",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions components/clarinet-sdk/src/vfs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as fs from "node:fs/promises";
import path from "node:path";

function fileArrayToString(bufferArray: Uint8Array) {
return Array.from(bufferArray)
Expand Down Expand Up @@ -58,6 +59,8 @@ async function readFiles(event: any) {

async function writeFile(event: unknown) {
if (!isValidWriteEvent(event)) throw new Error("invalid write event");
const dir = path.dirname(event.path);
if (dir !== ".") await fs.mkdir(dir, { recursive: true });
return fs.writeFile(event.path, Uint8Array.from(event.content));
}

Expand Down

0 comments on commit 871ff87

Please sign in to comment.