Skip to content

Commit

Permalink
properly parse commodity names
Browse files Browse the repository at this point in the history
  • Loading branch information
frosklis committed Mar 18, 2021
1 parent adcef36 commit 9c7a40d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ before_deploy: |
# Create the releases
# Macs
sudo apt install build-essential
# cargo build --release --target x86_64-apple-darwin
# Intel macs
cargo build --release --target x86_64-apple-darwin
# New macs
# cargo build --release --target aarch64-apple-darwin
# Raspberry
Expand All @@ -130,11 +131,17 @@ before_deploy: |
# cargo build --release --target x86_64-pc-windows-msvc
# Package everything
# tar -czf dinero-mac-x86_64.tar.gz /home/travis/build/frosklis/dinero-rs/target/x86_64-apple-darwin/release/dinero
cd /home/travis/build/frosklis/dinero-rs/target/x86_64-apple-darwin/release
tar -czf dinero-mac-x86_64.tar.gz dinero
mv dinero-mac-x86_64.tar.gz /home/travis/build/frosklis/dinero-rs/
# tar -czf dinero-mac-aarch64.tar.gz /home/travis/build/frosklis/dinero-rs/target/aarch64-apple-darwin/release/dinero
cd /home/travis/build/frosklis/dinero-rs/target/x86_64-pc-windows-gnu/release/
tar -czf dinero-windows-x86_64.tar.gz dinero.exe
mv dinero-windows-x86_64.tar.gz /home/travis/build/frosklis/dinero-rs/
# SHA 256 for brew
cd /home/travis/build/frosklis/dinero-rs/
sha_256=$(shasum -a 256 dinero-mac-x86_64.tar.gz | cut -f 1 -d " ")
fi
deploy:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog file for dinero-rs project, a command line application for managing fi
## [0.21.0] - xxx
### Changed
- Continuos integration pipeline is now better. No more problems like what happened between releases 0.18 and 0.20.
### Fixed
- Commodities get parsed properly, always removing quotes
## [0.20.0] - 2021-03-15
### Fixed
- Version numbers back on track
Expand Down
4 changes: 3 additions & 1 deletion src/parser/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ pub(crate) fn parse_string(string: Pair<Rule>) -> String {
quoted[1..len - 1].to_string()
}
Rule::unquoted => string.as_str().to_string(),
Rule::currency => parse_string(string.into_inner().next().unwrap()),
Rule::currency | Rule::commodity_in_directive => {
parse_string(string.into_inner().next().unwrap())
}
_ => string.as_str().to_string(),
}
}

0 comments on commit 9c7a40d

Please sign in to comment.