-
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
Showing
26 changed files
with
611 additions
and
194 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
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,20 @@ | ||
export class ClassMemory { | ||
public static all = new Map<string, ClassMemory>() | ||
|
||
/** | ||
* Nome da classe utilizada | ||
*/ | ||
name: string | ||
|
||
/** | ||
* Constrante que usa a class | ||
*/ | ||
constant: string | ||
|
||
constructor (options: ClassMemory) { | ||
this.name = options.name | ||
this.constant = options.constant | ||
|
||
ClassMemory.all.set(this.name, this) | ||
} | ||
} |
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
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,9 +1,28 @@ | ||
import { Colors } from '@loggings/beta' | ||
import { readFileSync } from 'fs' | ||
import { globSync } from 'glob' | ||
import { basename, dirname, join } from 'path' | ||
import { basename, dirname, extname, join } from 'path' | ||
import { fileURLToPath } from 'url' | ||
|
||
const rootFile = basename(fileURLToPath(import.meta.url)) | ||
const rootPath = dirname(fileURLToPath(import.meta.url)) | ||
export const getTransformers = () => rootFile === 'index.js' | ||
? globSync(join(rootPath, '..', 'transformers/**/*.sh'), { cwd: join('..', rootPath) }) | ||
: globSync('src/transformers/shellscript/**/*.sh', { cwd: process.cwd() }) | ||
|
||
export const getTransformer = (transformer: string) => { | ||
const files = new Map<string, string>() | ||
|
||
if (rootFile === 'index.js') { | ||
globSync(join(rootPath, '..', 'transformers/**/*.sh'), { cwd: join('..', rootPath) }) | ||
.forEach((filePath) => files.set(basename(filePath, extname(filePath)), filePath)) | ||
} else { | ||
globSync('src/transformers/shellscript/**/*.sh', { cwd: process.cwd() }) | ||
.forEach((filePath) => files.set(basename(filePath, extname(filePath)), filePath)) | ||
} | ||
|
||
const filePath = files.get(transformer) | ||
if (filePath) return readFileSync(filePath, { encoding: 'utf8' }) | ||
console.debug(Colors('red', `Transformer ${transformer} not found!`)) | ||
return '' | ||
} |
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
Oops, something went wrong.