This file contains 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 characters
# Sometimes cron jobs don't execute properly. It's hard to debug because | |
# the job may execute just fine if you run it manually in your shell. | |
# That's because cron jobs run in a minimal shell by default. | |
# This will run the script in a minimal environment: | |
env - /path/to/script.sh | |
# Spoiler alert: Usually, the solution is to define the shell in the script, | |
# by prepending #!/bin/bash. |
This file contains 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 characters
// To run: | |
// npm install globby | |
// node prepend-use-strict.js | |
var globby = require('globby'); | |
var fs = require('fs'); | |
globby('**/*.js', function(err, files) { | |
for (var i = 0, m = files.length; i < m; i++) { | |
var fileContent = fs.readFileSync(files[i]).toString(); |