Skip to content

Commit

Permalink
Merge pull request #1 from aq2r/dev
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
aq2r authored Dec 4, 2024
2 parents 9cad795 + 424fa7d commit 94af339
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,31 @@ on:

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive-name: linux
archive-suffix: tar.gz
archive-cmd: tar czf
executable-suffix: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
archive-name: windows
archive-suffix: zip
archive-cmd: 7z a
executable-suffix: .exe

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
targets: ${{ matrix.target }}

- name: Install cargo-about
run: cargo install cargo-about
Expand All @@ -37,16 +53,16 @@ jobs:
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
REPO_NAME=${GITHUB_REPOSITORY##*/}
RELEASE_NAME="${REPO_NAME}-${TAG_NAME}-windows"
RELEASE_NAME="${REPO_NAME}-${TAG_NAME}-${{ matrix.archive-name }}"
mkdir -p "${RELEASE_NAME}"
cp "target/release/${REPO_NAME}.exe" "${RELEASE_NAME}/"
cp "target/release/${REPO_NAME}${{ matrix.executable-suffix }}" "${RELEASE_NAME}/"
cp LICENSE README.md ThirdPartyLicenses.html "${RELEASE_NAME}/"
7z a "${RELEASE_NAME}.zip" "${RELEASE_NAME}"
${{ matrix.archive-cmd }} "${RELEASE_NAME}.${{ matrix.archive-suffix }}" "${RELEASE_NAME}"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: "*.zip"
files: "*.${{ matrix.archive-suffix }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 9 additions & 3 deletions crates/sbv2_api/src/model_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ impl Sbv2ModelInfo {
for (model_id_obj, model_info_obj) in json_value.as_object().unwrap().iter() {
let model_id: u32 = model_id_obj.parse()?;

let config_path = model_info_obj["config_path"].to_string();

let split_pattern = match config_path.contains("\\\\") {
true => "\\\\",
false => "/",
};

// モデルのフォルダ名
let folder_name = model_info_obj["config_path"]
.to_string()
.split("\\\\")
let folder_name = config_path
.split(split_pattern)
.nth(1)
.context("None Error")?
.to_string();
Expand Down

0 comments on commit 94af339

Please sign in to comment.