ADD_PATH : AADHAVAN
This commit is contained in:
parent
540985871a
commit
4eed069281
@ -221,7 +221,8 @@
|
||||
|
||||
|
||||
<script>
|
||||
const fs = require('fs');
|
||||
const fs = require('fs');
|
||||
const path =require('path');
|
||||
|
||||
require('dotenv').config();
|
||||
//get value from .env
|
||||
@ -239,8 +240,9 @@
|
||||
function loadXML(xmlFileName) {
|
||||
|
||||
//XmlPath get from .env
|
||||
const xmlPath=process.env.XML_FILE_PATH;
|
||||
console.log(xmlFileName)
|
||||
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||
const xmlPath =path.join(__dirname,xmlPathenv);
|
||||
console.log(xmlFileName)
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.readFile(`${xmlPath}`+xmlFileName, 'utf8', (error, data) => {
|
||||
if (error) {
|
||||
|
||||
@ -590,8 +590,10 @@ var xmlPath ="" //get the xml filepath in .env file local variable
|
||||
$(document).ready(function() {
|
||||
|
||||
require('dotenv').config();
|
||||
const path = require('path');
|
||||
//xmlPath added
|
||||
xmlPath=process.env.XML_FILE_PATH;
|
||||
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||
xmlPath=path.join(__dirname, xmlPathenv);
|
||||
// console.log(xmlPath);
|
||||
const isEncrypted = process.env.ENCRYPTED;
|
||||
// console.log(isEncrypted);
|
||||
|
||||
@ -275,8 +275,10 @@
|
||||
|
||||
|
||||
<script>
|
||||
const Swal = require('sweetalert2')
|
||||
const Swal = require('sweetalert2');
|
||||
|
||||
function uploadFile() {
|
||||
console.log("file upload");
|
||||
const fileInput = document.getElementById('fileInput');
|
||||
const selectedFile = fileInput.files[0];
|
||||
console.log(selectedFile)
|
||||
@ -289,7 +291,8 @@ var modal = document.getElementById('myModal');
|
||||
var fileInput = document.getElementById('fileInput');
|
||||
require('dotenv').config();
|
||||
//XmlPath get from .env
|
||||
const xmlPath=process.env.XML_FILE_PATH;
|
||||
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||
const xmlPath = path.join(__dirname,xmlPathenv);
|
||||
|
||||
function fileupload(filePaths) {
|
||||
|
||||
|
||||
6
main.js
6
main.js
@ -7,12 +7,14 @@ const jquery = require('jquery');
|
||||
let onlineStatus = true;
|
||||
const { dialog } = require('electron');
|
||||
const saveFile = require('./savexml')
|
||||
require('dotenv').config()
|
||||
require('dotenv').config({ path: path.join(__dirname, '.env') });
|
||||
let mainWindow;
|
||||
|
||||
|
||||
const auto_close= process.env.DISABLE_AUTO_CLOSE;
|
||||
const auto_close_time = parseInt(process.env.AUTO_CLOSE_TIME) * 1000;
|
||||
|
||||
let mainWindow;
|
||||
|
||||
|
||||
async function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
|
||||
1263
package-lock.json
generated
1263
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -5,12 +5,15 @@
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"test": "start",
|
||||
"start": "electron ."
|
||||
"start": "electron .",
|
||||
"build": "cross-env NODE_ENV=production electron-packager . ProjectB --platform=win32 --arch=x64"
|
||||
},
|
||||
"author": "venkatesh",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"electron": "^26.1.0"
|
||||
"electron": "^26.1.0",
|
||||
"electron-packager": "^17.1.2",
|
||||
"electron-wix-msi": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap-icons": "^1.11.1",
|
||||
|
||||
10
savexml.js
10
savexml.js
@ -2,12 +2,14 @@ const fs = require('fs');
|
||||
const cheerio = require('cheerio');
|
||||
const Swal = require('sweetalert2')
|
||||
const encode = require('./encode')
|
||||
const path = require('path')
|
||||
|
||||
require('dotenv').config();
|
||||
//Get the value from .env
|
||||
const isEncrypted = process.env.ENCRYPTED;
|
||||
|
||||
function saveXmlToFile(xmlData, filePath) {
|
||||
console.log(filePath);
|
||||
// Check if the file path is provided
|
||||
if (!filePath) {
|
||||
console.error('File path is required.');
|
||||
@ -50,8 +52,8 @@ function savexml(UserFilename) {
|
||||
}
|
||||
|
||||
//XmlPath get from .env
|
||||
const xmlPath=process.env.XML_FILE_PATH;
|
||||
|
||||
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||
const xmlPath = path.join(__dirname, xmlPathenv)
|
||||
// Get the json string from localStorage for set fileName
|
||||
var jsonData = localStorage.getItem("json");
|
||||
|
||||
@ -60,7 +62,9 @@ function savexml(UserFilename) {
|
||||
// var jsonfilename = `${UserFilename}.json`;
|
||||
|
||||
// file path where you want to save the XML file
|
||||
const xmlfilePath = process.cwd() + `/${xmlPath}` + xmlfilename;
|
||||
// const xmlfilePath = process.cwd() + `/${xmlPath}` + xmlfilename;
|
||||
|
||||
const xmlfilePath = `${xmlPath}` + xmlfilename;
|
||||
// const jsonfilePath = process.cwd() + '/xml/' + jsonfilename;
|
||||
|
||||
// Call the function to save the XML file
|
||||
|
||||
Loading…
Reference in New Issue
Block a user