diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a6e7958..f417b1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,6 @@ name: test on: push: branches: - - master - main pull_request: @@ -14,10 +13,9 @@ jobs: - uses: actions/checkout@v3 - uses: erlef/setup-beam@v1 with: - otp-version: "25.2" - gleam-version: "1.2.0" + otp-version: "27" + gleam-version: "1.9.0" rebar3-version: "3" # elixir-version: "1.14.2" - - run: gleam format --check src test - - run: gleam deps download - run: gleam test + - run: gleam format --check src test diff --git a/gleam.toml b/gleam.toml index ef04243..bcec7a7 100644 --- a/gleam.toml +++ b/gleam.toml @@ -4,15 +4,15 @@ description = "Basic file operations that work on all targets" licences = ["Apache-2.0"] repository = { type = "github", user = "bcpeinhardt", repo = "simplifile" } -gleam = ">= 0.32.0" +gleam = ">= 1.9.0" # links = [{ title = "Website", href = "https://gleam.run" }] [javascript.deno] allow_all = true [dependencies] -gleam_stdlib = "~> 0.34 or ~> 1.0" -filepath = "~> 1.0" +gleam_stdlib = ">= 0.34.0 and < 2.0.0" +filepath = ">= 1.0.0 and < 2.0.0" [dev-dependencies] -gleeunit = "~> 1.0" +gleeunit = ">= 1.0.0 and < 2.0.0" diff --git a/manifest.toml b/manifest.toml index e9adc58..cc72bab 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,12 +2,12 @@ # You typically do not need to edit this file packages = [ - { name = "filepath", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "EFB6FF65C98B2A16378ABC3EE2B14124168C0CE5201553DE652E2644DCFDB594" }, - { name = "gleam_stdlib", version = "0.34.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1FB8454D2991E9B4C0C804544D8A9AD0F6184725E20D63C3155F0AEB4230B016" }, - { name = "gleeunit", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D364C87AFEB26BDB4FB8A5ABDE67D635DC9FA52D6AB68416044C35B096C6882D" }, + { name = "filepath", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "65F51013BCF78A603AFFD7992EF1CC6ECA96C74038EB48887F656DE44DBC1902" }, + { name = "gleam_stdlib", version = "0.58.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "091F2D2C4A3A4E2047986C47E2C2C9D728A4E068ABB31FDA17B0D347E6248467" }, + { name = "gleeunit", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "0E6C83834BA65EDCAAF4FE4FB94AC697D9262D83E6F58A750D63C9F6C8A9D9FF" }, ] [requirements] -filepath = { version = "~> 1.0"} -gleam_stdlib = { version = "~> 0.34 or ~> 1.0" } -gleeunit = { version = "~> 1.0" } +filepath = { version = ">= 1.0.0 and < 2.0.0" } +gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } +gleeunit = { version = ">= 1.0.0 and < 2.0.0" } diff --git a/src/simplifile_js.mjs b/src/simplifile_js.mjs index 0de01a5..827a0df 100644 --- a/src/simplifile_js.mjs +++ b/src/simplifile_js.mjs @@ -27,7 +27,9 @@ export function readBits(filepath) { * @returns {Ok | GError} */ export function writeBits(filepath, contents) { - return gleamResult(() => fs.writeFileSync(path.normalize(filepath), contents.buffer)); + return gleamResult(() => + fs.writeFileSync(path.normalize(filepath), contents.rawBuffer), + ); } /** @@ -38,7 +40,9 @@ export function writeBits(filepath, contents) { * @returns {Ok | GError} */ export function appendBits(filepath, contents) { - return gleamResult(() => fs.appendFileSync(path.normalize(filepath), contents.buffer)); + return gleamResult(() => + fs.appendFileSync(path.normalize(filepath), contents.rawBuffer), + ); } /** @@ -163,7 +167,9 @@ export function readDirectory(filepath) { * @returns {Ok | GError} */ export function copyFile(srcpath, destpath) { - return gleamResult(() => fs.copyFileSync(path.normalize(srcpath), path.normalize(destpath))); + return gleamResult(() => + fs.copyFileSync(path.normalize(srcpath), path.normalize(destpath)), + ); } /** @@ -174,7 +180,9 @@ export function copyFile(srcpath, destpath) { * @returns {Ok | GError} */ export function renameFile(srcpath, destpath) { - return gleamResult(() => fs.renameSync(path.normalize(srcpath), path.normalize(destpath))); + return gleamResult(() => + fs.renameSync(path.normalize(srcpath), path.normalize(destpath)), + ); } /** @@ -204,8 +212,8 @@ export function currentDirectory() { */ export function fileInfo(filepath) { return gleamResult(() => { - const stat = fs.statSync(path.normalize(filepath)) - return new FileInfo(stat) + const stat = fs.statSync(path.normalize(filepath)); + return new FileInfo(stat); }); } @@ -215,9 +223,9 @@ export function fileInfo(filepath) { */ export function linkInfo(filepath) { return gleamResult(() => { - const stat = fs.lstatSync(path.normalize(filepath)) - return new FileInfo(stat) - }) + const stat = fs.lstatSync(path.normalize(filepath)); + return new FileInfo(stat); + }); } class FileInfo {