feature/completion
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 1 | pub mod constants; |
| 2 | |
| 3 | use anyhow::{anyhow, Result}; |
| 4 | use log::debug; |
| 5 | |
| 6 | pub async fn get_token() -> Result<String> { |
| 7 | if let Some(mut path) = dirs::home_dir() { |
| 8 | path.push(".smb/token"); |
| 9 | std::fs::read_to_string(path).map_err(|e| { |
| 10 | debug!("Error while reading token: {}", &e); |
| 11 | anyhow!("Error while reading token. Are you logged in?") |
| 12 | }) |
| 13 | } else { |
| 14 | Err(anyhow!("Failed to get home directory.")) |
| 15 | } |
| 16 | } |