Comparing version 1.3.0 to 1.4.0
10
index.js
@@ -9,2 +9,3 @@ #!/usr/bin/env node | ||
const prompt = require('./Utils/input-operations'); | ||
const path= require('path') | ||
const assert = require('assert'); | ||
@@ -44,7 +45,6 @@ | ||
const drafts_path = './VOLUMES/Drafts/'; | ||
const drafts_info_path = './VOLUMES/drafts.json'; | ||
(!readdirSync('./').includes('VOLUMES'))&&mkdirSync('./VOLUMES'); | ||
!readdirSync("./VOLUMES").includes("drafts.json")&&writeFileSync(drafts_info_path,JSON.stringify({drafts:[]})); | ||
!readdirSync("./VOLUMES").includes("Drafts")&&mkdirSync(drafts_path); | ||
const drafts_path = path.join(__dirname,'/VOLUMES/Drafts/'); | ||
const drafts_info_path = path.join(__dirname, '/VOLUMES/drafts.json'); | ||
!readdirSync(path.join(__dirname,"VOLUMES")).includes("drafts.json")&&writeFileSync(drafts_info_path,JSON.stringify({drafts:[]})); | ||
!readdirSync(path.join(__dirname,"VOLUMES")).includes("Drafts")&&mkdirSync(drafts_path); | ||
const get_drafts_object = () => JSON.parse( readFileSync( drafts_info_path, {encoding:'utf-8'} ) ).drafts; | ||
@@ -51,0 +51,0 @@ const commit_drafts = ( updated_drafts ) => writeFileSync( drafts_info_path, JSON.stringify( {drafts:updated_drafts}, null, 4 ) ); |
{ | ||
"name": "mail-cli", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"main": "./index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
162332