Skip to content

Commit

Permalink
Source of Alpha-1.0.1 Very Little Bit Changed Folder Structure. At ne…
Browse files Browse the repository at this point in the history
…xt commit i will try to make Source Structure Good!
  • Loading branch information
codesculpture committed Aug 20, 2022
1 parent 9c6521c commit f83a06e
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.vim
test
tests
*.exe
build
native-cpp
.gitignore

deno/binaries
.env
.gitignore
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Cmon
![Logo](/media/logo/cmon-logo-200x200.png)

Command-Line-Interface for watching C++ Programs and executing it.

No More Compile and Execute.
Expand All @@ -13,14 +15,14 @@ Just it needs the File Name of the Program.
### Samples
It is Just a C++ Program.

![A Program](/screenShots/1.png)
![A Program](/media/screenShots/1.png)

And then we just call our Binary with the filename of Program
![Calling](/screenShots/2.png)
![Calling](/media/screenShots/2.png)
Then it starts to *watch*

If some changes occur in source file the watcher will recompile and execute it.
![ReCompile](/screenShots/3.png)
![ReCompile](/media/screenShots/3.png)


### Compiling Source
Expand Down
4 changes: 2 additions & 2 deletions deno/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tasks": {
"dev": "deno run --allow-write --allow-read --allow-run main.ts ./tests/test.cpp",
"build": "deno compile --allow-write --allow-run --allow-read main.ts"
"dev": "deno run --allow-env --allow-write --allow-read --allow-run main.ts",
"build": "deno compile --allow-env --output ../build/deno/cmon.exe --allow-write --allow-run --allow-read main.ts"
}
}
20 changes: 16 additions & 4 deletions deno/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import { bold, blue,green, red, yellow, italic} from "https://deno.land/[email protected]/fmt/colors.ts";
import checkFolder from "./src/checkFolder.ts";
import {checkFolder, showVersion} from "./src/index.ts";

const printFileError = (): void => {
console.log(red(bold("Error At Loading File. Please Make Sure You provided correct Name")));
}


if(Deno.args[0] == undefined) {
printFileError();
Deno.exit(0);
}
if(Deno.args[0] == 'version') {
console.log(bold(yellow('Version')));
console.log(showVersion());
Deno.exit(0);
}

const PATH = Deno.args[0];

Expand All @@ -8,9 +23,6 @@ const fileNameArr = Deno.args[0].split('/');
const FILE_NAME = fileNameArr.at(-1);


const printFileError = (): void => {
console.log(red(bold("Error At Loading File. Please Make Sure You provided correct Name")));
}
if(!FILE_NAME) {
printFileError();
Deno.exit(0);
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions deno/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import checkFolder from './checkFolder/checkFolder.ts';
import showVersion from './version/version.ts'


export {checkFolder, showVersion};
8 changes: 8 additions & 0 deletions deno/src/version/version.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import showVersion from './version.ts';
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";


Deno.test("Print Version Test", () => {
const ver = showVersion();
assertEquals(ver, Deno.env.get("VERSION"));
});
7 changes: 7 additions & 0 deletions deno/src/version/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import "https://deno.land/x/dotenv/load.ts";

const showVersion = (): string | undefined => {
return Deno.env.get('VERSION');
}

export default showVersion;
Binary file added media/logo/cmon-logo-200x200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/logo/cmon-logo-500x500.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit f83a06e

Please sign in to comment.