From 0685d2e4c8812ecae4d5284bc7fc7739b6d2c16c Mon Sep 17 00:00:00 2001 From: Liz/Alice Cray Date: Fri, 4 Oct 2024 19:04:08 -0400 Subject: [PATCH] fix typo --- index.mjs | 4 ++++ package.json | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/index.mjs b/index.mjs index f8262b3..7a2200d 100644 --- a/index.mjs +++ b/index.mjs @@ -2,10 +2,14 @@ export const handler = async (event) => { let result = "did not send"; if (event.subject == "You have deliveries" || event.subject == "You have a delivery"){ // Trigger home notification + console.info("Matched Subject"); const command = `ssh ${process.env.INTERNAL_HOST} "/usr/bin/tmux neww -d \"/usr/bin/mplayer '${process.env.INTERNAL_FILE}'\""`; + console.info("Import ssh2"); import { Client } from 'ssh2'; const connection = new Client(); + console.info("Set Conn Info"); connection.on('ready', () => { + console.info("Connection READY") connection.exec(command, (error, stream) => { if (error) { console.warn(error); diff --git a/package.json b/package.json index ddb43e7..afa3445 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,9 @@ "description": "Trigger notif from matching WorkMail email", "main": "index.mjs", "scripts": { - "deploy": "npm run package && aws lambda update-function-code --function-name Deliveries --region us-west-2 --zip-file fileb://./lambda.zip", - "package": "zip -r -9 lambda.zip ." + "deploy": "npm run lint && npm run package && aws lambda update-function-code --function-name Deliveries --region us-west-2 --zip-file fileb://./lambda.zip", + "package": "zip -r -9 lambda.zip .", + "lint": "npx eslint index.mjs --fix" }, "repository": { "type": "git",