Updates
This commit is contained in:
+8
-13
@@ -1,19 +1,14 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const rootDir = path_1.default.resolve(__dirname, "../../../");
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
const rootDir = path.resolve(__dirname, "../../../");
|
||||
const ignorePattern = /\/\.git\/|\/\.next\/|\/\.dist\/|node_modules|\/\.local_dist\/|\/\.tmp\/|\/types\/|\.config\.js|\/public\//;
|
||||
function transformJsToTs(dir) {
|
||||
var _a;
|
||||
const dirContent = fs_1.default.readdirSync(dir);
|
||||
const dirContent = fs.readdirSync(dir);
|
||||
for (let i = 0; i < dirContent.length; i++) {
|
||||
const fileFolder = dirContent[i];
|
||||
const fullFileFolderPath = path_1.default.join(dir, fileFolder);
|
||||
const stat = fs_1.default.statSync(fullFileFolderPath);
|
||||
const fullFileFolderPath = path.join(dir, fileFolder);
|
||||
const stat = fs.statSync(fullFileFolderPath);
|
||||
if (stat.isDirectory()) {
|
||||
transformJsToTs(fullFileFolderPath);
|
||||
continue;
|
||||
@@ -31,8 +26,8 @@ function transformJsToTs(dir) {
|
||||
console.log(newFilePath);
|
||||
console.log("\n/////////////////////////////////////////");
|
||||
console.log("/////////////////////////////////////////\n");
|
||||
fs_1.default.copyFileSync(fullFileFolderPath, newFilePath);
|
||||
fs_1.default.unlinkSync(fullFileFolderPath);
|
||||
fs.copyFileSync(fullFileFolderPath, newFilePath);
|
||||
fs.unlinkSync(fullFileFolderPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user