Add success message to setup.sh

This commit is contained in:
Max Wofford
2025-03-13 16:47:12 -04:00
parent 61a8dbb080
commit d4141d1ab4
4 changed files with 13 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
<div class="setup-instructions">
<h3>Mac/Linux users:</h3>
<div class="code-block">
<code>export HACKATIME_API_KEY="<%= @current_user_api_key %>" && export HACKATIME_API_URL="<%= api_hackatime_v1_url %>" && curl -sSL <%= root_url %>hackatime/setup.sh | bash</code>
<code>export HACKATIME_API_KEY="<%= @current_user_api_key %>" && export HACKATIME_API_URL="<%= api_hackatime_v1_url %>" && export SUCCESS_URL="<%= root_url %>/success.txt" && curl -sSL <%= root_url %>hackatime/setup.sh | bash</code>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
<iframe width="560" height="315" src="https://www.youtube.com/embed/QTwhJy7nT_w?si=oBaImbr8MOqMlzlK&autoplay=1&loop=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

View File

@@ -56,10 +56,10 @@ Rails.application.routes.draw do
patch "my/settings", to: "users#update"
post "my/settings/migrate_heartbeats", to: "users#migrate_heartbeats", as: :my_settings_migrate_heartbeats
get "my/wakatime_setup", to: "users#wakatime_setup", as: :my_wakatime_setup
get "my/wakatime_setup/step-2", to: "users#wakatime_setup_step_2", as: :my_wakatime_setup_step_2
get "my/wakatime_setup/step-3", to: "users#wakatime_setup_step_3", as: :my_wakatime_setup_step_3
get "my/wakatime_setup/step-4", to: "users#wakatime_setup_step_4", as: :my_wakatime_setup_step_4
get "my/wakatime_setup", to: "users#wakatime_setup"
get "my/wakatime_setup/step-2", to: "users#wakatime_setup_step_2"
get "my/wakatime_setup/step-3", to: "users#wakatime_setup_step_3"
get "my/wakatime_setup/step-4", to: "users#wakatime_setup_step_4"
post "/sailors_log/slack/commands", to: "slack#create"
post "/timedump/slack/commands", to: "slack#create"

View File

@@ -39,6 +39,7 @@ http_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')
if [ "$http_code" = "200" ] || [ "$http_code" = "202" ]; then
curl "$SUCCESS_URL"
echo -e "\nTest heartbeat sent successfully"
else
echo -e "\nError sending heartbeat: $body"

7
public/success.txt Normal file
View File

@@ -0,0 +1,7 @@
_____ _
/ ____| | |
| (___ _ _ ___ ___ ___ ___ ___| |
\___ \| | | |/ __/ __/ _ \ __/ __| |
____) | |_| | (__ (__ __\__ \__ \_|
|_____/ \__,_|\___\___\___|___/___(_)