Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
PKVadde committed Sep 12, 2024
1 parent c02cf34 commit 203509a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,6 @@ jobs:
command: install
args: --color=always --git=https://github.com/cross-rs/cross.git --locked --rev=02bf930e0cb0c6f1beffece0788f3932ecb2c7eb --verbose cross

- name: Test secret
env:
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
run: |
if [ -n "$POSTHOG_API_KEY" ]; then
echo "Secret is set and not empty"
else
echo "Secret is not set or empty"
exit 1
fi
- name: Build binary
uses: actions-rs/cargo@v1
env:
Expand Down
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ pub async fn main() -> ExitCode {
env::remove_var("RUST_LIB_BACKTRACE");
env::remove_var("RUST_BACKTRACE");

let key = env::var("POSTHOG_API_KEY");
if key.is_err() {
println!("POSTHOG_API_KEY is not set");
} else {
println!("POSTHOG_API_KEY is set");
}

let flag_file = get_config_path().unwrap().with_file_name(".vpm_welcome_shown");
if !flag_file.exists() {
create_config().unwrap();

println!("Welcome to vpm!");
println!("We collect anonymous usage data to improve the tool.");
println!("The following information will be collected:");
Expand Down

0 comments on commit 203509a

Please sign in to comment.