Skip to content

Commit

Permalink
feat: add remix.init functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensacks committed Sep 17, 2024
1 parent 370c66c commit 73dd708
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
22 changes: 4 additions & 18 deletions remix.init/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
/* eslint-disable no-console */
import {rename} from 'node:fs';
import path from 'node:path';

const initializeEnvironment = () => {
const originalFile = path.resolve('./.env.example');
const renamedFile = path.resolve('./.env');
rename(originalFile, renamedFile, (error) => {
if (error) {
console.error('ERROR:', error);
}
});
/* eslint-disable unicorn/prefer-module,unicorn/no-anonymous-default-export */
module.exports = async (...args) => {
const {default: main} = await import('./index.mjs');
await main(...args);
};

const main = () => {
initializeEnvironment();
};

export default main;
19 changes: 19 additions & 0 deletions remix.init/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable no-console */
import {rename} from 'node:fs';
import path from 'node:path';

const initializeEnvironment = () => {
const originalFile = path.resolve('./.env.example');
const renamedFile = path.resolve('./.env');
rename(originalFile, renamedFile, (error) => {
if (error) {
console.error('ERROR:', error);
}
});
};

const main = () => {
initializeEnvironment();
};

export default main;
3 changes: 1 addition & 2 deletions remix.init/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"name": "remix.init",
"private": true,
"main": "index.js",
"license": "MIT",
"type": "module"
"license": "MIT"
}

0 comments on commit 73dd708

Please sign in to comment.