Skip to content

Commit daff121

Browse files
committed
✨ tweak: add info function
1 parent 0da9756 commit daff121

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "magicc",
3-
"version": "0.1.0",
3+
"version": "0.0.1",
44
"author": "Waren Gonzaga",
55
"description": "You can do `magicc`, you can build anything that you desire.",
66
"keywords": [

source/app.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ import {Text} from 'ink';
33
import BigText from 'ink-big-text';
44
import Gradient from 'ink-gradient';
55
import getGitDiff from './utils/openai.js';
6+
import info from './utils/info.js';
67

78
export default function App() {
8-
getGitDiff();
9-
9+
// getGitDiff();
1010
return (
1111
<>
12-
<Gradient name="passion">
13-
<BigText text="Magicc" />
12+
<Text color='yellow'>Note: Coming Soon... Follow @warengonzaga for updates</Text>
13+
<Gradient name='passion'>
14+
<BigText text='Magicc' />
1415
<Text>You can do `magicc`, you can build anything that you desire. 🪄</Text>
1516
</Gradient>
17+
<Text>Version: <Text color='green'>{info('version')}</Text> | Author: <Text color='blue'>{info('author')}</Text></Text>
1618
</>
1719
);
1820
}

source/utils/info.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import packageJSON from '../../package.json';
2+
3+
const { author, version } = packageJSON;
4+
5+
const info = (info) => {
6+
if (info === 'version') {
7+
return version;
8+
} else if (info === 'author') {
9+
return author;
10+
} else {
11+
return console.error('Invalid info type');
12+
}
13+
}
14+
15+
export default info;

0 commit comments

Comments
 (0)