-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e290a0
commit 92bf718
Showing
9 changed files
with
511 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"printWidth": 150 | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
# upp | ||
Universal Pre-Processor | ||
Universal File Pre-Processor | ||
|
||
|
||
any file with | ||
|
||
./tool test.txt --VAR=bla > out.txt | ||
|
||
ifeq | ||
ifne (!=) | ||
iflt (<) | ||
ifgt | ||
ifge | ||
ifle (<=) | ||
|
||
--- test.txt | ||
!!ifeq VAR bla!! | ||
lol | ||
!!endif!! | ||
|
||
--- alternative same zeile | ||
|
||
test !#ifeq |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const yargs_1 = __importDefault(require("yargs/yargs")); | ||
const helpers_1 = require("yargs/helpers"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const fs = __importStar(require("fs")); | ||
const log = console.log; | ||
(0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)) | ||
.scriptName("upp") | ||
.usage("Universal Pre-Processor ('upp') is a tool for preprocessing files.") | ||
.epilogue("for more info and support visit https://github.com/adrianschubek/upp") | ||
.version("0.1.0") | ||
// .command("check <file>", "checks the preprocessor", (builder) => {}) | ||
.command(["run <file>", "$0"], "runs the preprocessor", (builder) => { | ||
builder | ||
.positional("file", { | ||
alias: "f", | ||
describe: "the file to preprocess", | ||
type: "string", | ||
demandOption: true, | ||
}) | ||
.option("output", { | ||
alias: "o", | ||
describe: "the output file", | ||
default: "stdout", | ||
type: "string", | ||
}); | ||
}, (argv) => { | ||
log(argv); | ||
if (!fs.existsSync(argv.file)) | ||
log(chalk_1.default.red("File does not exist!")); | ||
if (argv.output === "stdout") { | ||
log(chalk_1.default.yellow("Outputting to stdout...")); | ||
} | ||
}) | ||
.option("verbose", { | ||
describe: "verbose output", | ||
type: "boolean", | ||
default: false, | ||
}) | ||
.demandCommand(1) | ||
.parse(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "upp", | ||
"version": "0.1.0", | ||
"description": "Universal Pre-Processor", | ||
"main": "dist/index.js", | ||
"scripts": {}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/adrianschubek/upp.git" | ||
}, | ||
"author": "Adrian Schubek", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/adrianschubek/upp/issues" | ||
}, | ||
"homepage": "https://github.com/adrianschubek/upp#readme", | ||
"dependencies": { | ||
"chalk": "^4.1.2", | ||
"yargs": "^17.7.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.15.0", | ||
"@types/yargs": "^17.0.22" | ||
} | ||
} |
Oops, something went wrong.