Last active
February 13, 2026 13:05
-
-
Save Jamesits/46862ff152b2c0e1414af66226632347 to your computer and use it in GitHub Desktop.
Convert a text file to a patch file
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
| #!/usr/bin/env bash | |
| # convert a text file to a patch file | |
| set -Eeuo pipefail | |
| # usage: file2patch "source/file" "relative/destination/path" "patch/file" | |
| file2patch() { | |
| local SRCFILE="$1" | |
| local PATCHPATH="$2" | |
| local OUTFILE="$3" | |
| local FILEMODE="$(stat -c '%a' "${SRCFILE}")" | |
| local LINECOUNT="$(wc -l "${SRCFILE}" | cut -d' ' -f1)" | |
| ( | |
| printf "diff --git a/%s b/%s\n" "${PATCHPATH}" "${PATCHPATH}" | |
| printf "new file mode 100%s\n" "${FILEMODE}" | |
| printf "index 00000000..11451419\n" | |
| printf "%s\n" "--- /dev/null" # "printf --" will cause parsing problems | |
| printf "+++ b/%s\n" "${PATCHPATH}" | |
| printf "@@ -0,0 +1,%d @@\n" "${LINECOUNT}" | |
| cat "${SRCFILE}" | sed -e 's/^/+/g' | |
| ) > "${OUTFILE}" | |
| } | |
| file2patch "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From cb27e6f176e8e288c684364c0055f16a88cbceb1 Mon Sep 17 00:00:00 2001
From: Claude noreply@anthropic.com
Date: Fri, 13 Feb 2026 12:17:32 +0000
Subject: [PATCH] feat: add get_article operation node
Create a new 3P node that retrieves a DevRev article by ID, returning
extended fields: title, body, status, author, dates, tags, and
applies_to_parts.
.../functions/get_article_handler/index.ts | 96 +++++++++++++++++++
fixtures/get_article_event.json | 25 +++++
manifest.yaml | 95 ++++++++++++++++++
package.json | 22 +++++
tsconfig.json | 17 ++++
5 files changed, 255 insertions(+)
create mode 100644 code/src/functions/get_article_handler/index.ts
create mode 100644 fixtures/get_article_event.json
create mode 100644 manifest.yaml
create mode 100644 package.json
create mode 100644 tsconfig.json
diff --git a/code/src/functions/get_article_handler/index.ts b/code/src/functions/get_article_handler/index.ts
new file mode 100644
index 0000000..345b069
--- /dev/null
+++ b/code/src/functions/get_article_handler/index.ts
@@ -0,0 +1,96 @@
+import {
+} from '@devrev/typescript-sdk/dist/snap-ins';
+import { client } from '@devrev/typescript-sdk';
+export const run = async (events: FunctionInput[]) => {
+};
+export default run;
diff --git a/fixtures/get_article_event.json b/fixtures/get_article_event.json
new file mode 100644
index 0000000..6f98a39
--- /dev/null
+++ b/fixtures/get_article_event.json
@@ -0,0 +1,25 @@
+{
+}
diff --git a/manifest.yaml b/manifest.yaml
new file mode 100644
index 0000000..006e704
--- /dev/null
+++ b/manifest.yaml
@@ -0,0 +1,95 @@
+version: "2"
+name: "Get Article"
+description: "Retrieve a DevRev article by its ID"
+service_account:
+functions:
+operations:
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..c893a04
--- /dev/null
+++ b/package.json
@@ -0,0 +1,22 @@
+{
+}
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..76b4eb1
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,17 @@
+{
+}
--
2.43.0