~aprates/gempress

gempress/src/absolute.c -rw-r--r-- 406 bytes
fc494358Antonio Prates Fix html lang bug 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// GemPress feed path replacer utility, using Sugar-C
// 2021, by Antonio Prates <hello@aprates.dev>
// prepends the local path with the absolute path

#include <sugar.h>

app({
  if (argc < 3) {
    println("absolute: provide args: <feedFile> <absoluteFeedDir>");
  } else {
    string in = readFile((argv[1]));
    if (in)
      printf("%s", replaceWord(in, "=> ", join3s("=> /", argv[2], "/")));
  }
})