Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
ci(fix): pre create api_key file as cross test got permission denied …
Browse files Browse the repository at this point in the history
…when create it
  • Loading branch information
thoongnv committed Nov 17, 2023
1 parent 1a77e45 commit 81466f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,20 @@ jobs:
echo "target dir is: ${{ env.TARGET_DIR }}"
- name: Build
run: |
${{ env.CARGO }} build --verbose ${{ env.TARGET_FLAGS }}
${{ env.CARGO }} clean
run: ${{ env.CARGO }} build --verbose ${{ env.TARGET_FLAGS }}

- name: Run tests
if: matrix.build != 'macos-arm'
shell: bash
run: ${{ env.CARGO }} test ${{ env.TARGET_FLAGS }} -- --nocapture
run: |
if [[ "${{ matrix.os }}" = "ubuntu-latest" ]]; then
echo "Create temp $HOME/.config/shodan/api_key file ..."
mkdir -p $HOME/.config/shodan
echo "key" > $HOME/.config/shodan/api_key
chmod -R 777 $HOME/.config
ls -lh /home
ls -lh $HOME
ls -lh $HOME/.config/shodan
fi
${{ env.CARGO }} test ${{ env.TARGET_FLAGS }} -- --nocapture
4 changes: 1 addition & 3 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn get_config_dir() -> String {
let mut home_dir_str = String::new();

if let Some(home_dir) = dirs::home_dir() {
let mut dir_str = home_dir.display().to_string();
let dir_str = home_dir.display().to_string();

if Path::new(&format!("{}/.shodan", dir_str)).is_dir() {
home_dir_str = format!("{}/.shodan", dir_str);
Expand All @@ -17,8 +17,6 @@ pub fn get_config_dir() -> String {
}
}

println!("{}", home_dir_str);

home_dir_str
}

Expand Down

0 comments on commit 81466f6

Please sign in to comment.