From 91cdd77b1387269ed6e749d725df30d800c487b5 Mon Sep 17 00:00:00 2001 From: Amritanshu Pandey Date: Fri, 23 Sep 2022 00:15:31 +1000 Subject: [PATCH] use platform specific file ending --- .github/workflows/release.yml | 12 +----------- Cargo.toml | 2 +- src/main.rs | 9 +++++++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47f351f..fb3c864 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,14 +59,4 @@ jobs: upload_url: ${{ needs.create_release.outputs.upload_url }} asset_path: ./target/release/${{ matrix.asset_name }} asset_name: ${{ matrix.asset_name }} - asset_content_type: application/tar+gzip - - name: upload example config file - id: upload-release-assets - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: ./example/fakejson.yaml - asset_name: config.yaml - asset_content_type: application/text \ No newline at end of file + asset_content_type: application/tar+gzip \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 511dc35..9f49ff8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fakelogs" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index eb81975..df32a01 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,12 +3,17 @@ mod config; mod generators; mod log_generator; +#[cfg(windows)] +const LINE_ENDING : &'static str = "\r\n"; +#[cfg(not(windows))] +const LINE_ENDING : &'static str = "\n"; + fn main() { let list_of_names: Vec<&str> = include_str!("./dataset/data/names_sampled.txt") - .split("\n") + .split(LINE_ENDING) .collect::>(); let list_of_words: Vec<&str> = include_str!("./dataset/data/words_sampled.txt") - .split("\n") + .split(LINE_ENDING) .collect::>(); let args = cli::get_cli_args();