Created
December 30, 2018 02:42
-
-
Save jakebathman/b4e35565b29d11f9cf2bcf1ffc0f346d to your computer and use it in GitHub Desktop.
Test file for createAlarm function PR for Shortcuts JS
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 characters
// Only used to create the .shortcut file | |
const fs = require('fs'); | |
const { | |
buildShortcut, | |
} = require('./'); | |
const { | |
comment, | |
createAlarm, | |
} = require('./actions'); | |
// Define our list of actions | |
const actions = [ | |
comment({ | |
text: 'This will create an 8:42 AM alarm, repeating every S,M,W,F,S. This is a companion to PR joshfarrant/shortcuts-js#55', | |
}), | |
createAlarm({ | |
label: 'Repeating test alarm', | |
time: '8:42 AM', | |
repeat: ['Sunday', 'Monday', 'Wednesday', 'Friday', 'Saturday'], | |
}), | |
]; | |
// Generate the Shortcut data | |
const shortcut = buildShortcut(actions); | |
// Write the Shortcut to a file in the current directory | |
fs.writeFile('Test Create Alarm.shortcut', shortcut, (err) => { | |
if (err) { | |
console.error('Something went wrong :(', err); | |
return; | |
} | |
console.log('Shortcut created!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment