Last active
          August 5, 2025 05:33 
        
      - 
      
 - 
        
Save isurfer21/3a8b51d2b00314ff1d409bd5bf3f3697 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
isurfer21 revised this gist
Aug 5, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,8 @@ NODE_MODULES_DIR="node_modules" if [ ! -d "$NODE_MODULES_DIR" ]; then echo "node_modules directory does not exist." else # Get the last modified time of the most recently modified file in node_modules LAST_MODIFIED=$(find "$NODE_MODULES_DIR" -type f -exec stat -f %m {} + | sort -n | tail -1) # Get the current time CURRENT_TIME=$(date +%s)  - 
        
isurfer21 created this gist
Aug 5, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ #!/bin/bash # Define the path to the node_modules directory NODE_MODULES_DIR="node_modules" # Check if node_modules directory exists if [ ! -d "$NODE_MODULES_DIR" ]; then echo "node_modules directory does not exist." else # Get the last modified time of node_modules LAST_MODIFIED=$(stat -f %m "$NODE_MODULES_DIR") # Get the current time CURRENT_TIME=$(date +%s) # Calculate the age of node_modules in days AGE_DAYS=$(( (CURRENT_TIME - LAST_MODIFIED) / 86400 )) # Define the threshold for "old enough" (e.g., 7 days) THRESHOLD_DAYS=7 if [ "$AGE_DAYS" -ge "$THRESHOLD_DAYS" ]; then echo "node_modules is $AGE_DAYS days old." else echo "node_modules is up to date." fi fi