]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/process_config.awk
Imported Upstream version 1.1+hg7904
[dactyl.git] / common / process_config.awk
diff --git a/common/process_config.awk b/common/process_config.awk
new file mode 100644 (file)
index 0000000..4582f7b
--- /dev/null
@@ -0,0 +1,22 @@
+BEGIN {
+    chrome = "chrome"
+    if (suffix)
+        chrome = suffix
+}
+/^    \}/              { on = 0 }
+
+on && $NF ~ /^"([a-z]|\.\/)/ {
+    $NF = "\"/" name "/" substr($NF, 2)
+}
+/./ && on {
+    sub(/^"\.\./, "\"", $NF);
+    $NF = "\"" chrome substr($NF, 2)
+}
+/./ && on {
+    gsub(/\/\.\//, "/")
+    sub(/^\"\.\.\/common\//, "\"", $NF)
+    $0 = "        " $0
+}
+//
+
+/^    "resources": \{/ { on = 1 }