diff --git a/History.md b/History.md index fe2d516..816fbfe 100644 --- a/History.md +++ b/History.md @@ -1,5 +1,9 @@ # Changelog for JAUL +1.0.4 +===== +* IO getFilePath() will try local / absolute path last. + 1.0.3 ===== * Removed .git from package. diff --git a/docs/classes/_data_.datautils.html b/docs/classes/_data_.datautils.html index 91a6e98..bd60f1d 100644 --- a/docs/classes/_data_.datautils.html +++ b/docs/classes/_data_.datautils.html @@ -110,7 +110,7 @@
Static minifyJson
Static removeFromStrin
@@ -232,7 +232,7 @@
diff --git a/docs/classes/_io_.ioutils.html b/docs/classes/_io_.ioutils.html
index 4741874..53a7283 100644
--- a/docs/classes/_io_.ioutils.html
+++ b/docs/classes/_io_.ioutils.html
@@ -110,7 +110,7 @@
Static uuid
Static copyFileSync
@@ -147,7 +147,7 @@
@@ -187,7 +187,7 @@
@@ -219,7 +219,7 @@
diff --git a/docs/classes/_network_.networkutils.html b/docs/classes/_network_.networkutils.html
index c17f05f..bc8aa0b 100644
--- a/docs/classes/_network_.networkutils.html
+++ b/docs/classes/_network_.networkutils.html
@@ -111,7 +111,7 @@
@@ -143,7 +143,7 @@
@@ -175,7 +175,7 @@
@@ -198,7 +198,7 @@
@@ -221,7 +221,7 @@
diff --git a/docs/classes/_system_.systemutils.html b/docs/classes/_system_.systemutils.html
index 7f70643..f2e6697 100644
--- a/docs/classes/_system_.systemutils.html
+++ b/docs/classes/_system_.systemutils.html
@@ -108,7 +108,7 @@
@@ -131,7 +131,7 @@
diff --git a/docs/interfaces/_system_.cpuload.html b/docs/interfaces/_system_.cpuload.html
index f31937c..85caefc 100644
--- a/docs/interfaces/_system_.cpuload.html
+++ b/docs/interfaces/_system_.cpuload.html
@@ -104,7 +104,7 @@ idle: number
@@ -119,7 +119,7 @@ total: number
diff --git a/docs/interfaces/_system_.getinfooptions.html b/docs/interfaces/_system_.getinfooptions.html
index f3fd876..5413b14 100644
--- a/docs/interfaces/_system_.getinfooptions.html
+++ b/docs/interfaces/_system_.getinfooptions.html
@@ -103,7 +103,7 @@ labels: boolean
diff --git a/docs/interfaces/_system_.systemmetrics.html b/docs/interfaces/_system_.systemmetrics.html
index 08ba697..cb0b832 100644
--- a/docs/interfaces/_system_.systemmetrics.html
+++ b/docs/interfaces/_system_.systemmetrics.html
@@ -111,7 +111,7 @@ cpuCores: number
@@ -126,7 +126,7 @@ hostname: string
@@ -141,7 +141,7 @@ loadAvg: any
@@ -156,7 +156,7 @@ memoryTotal: any
@@ -171,7 +171,7 @@ memoryUsage: any
@@ -186,7 +186,7 @@ platform: string
@@ -201,7 +201,7 @@ process: any
@@ -216,7 +216,7 @@ title: string
@@ -231,7 +231,7 @@ uptime: string
diff --git a/docs/modules/_index_.html b/docs/modules/_index_.html
index 0fda229..3076b4a 100644
--- a/docs/modules/_index_.html
+++ b/docs/modules/_index_.html
@@ -85,7 +85,7 @@
@@ -99,7 +99,7 @@ data: any = require("./data")
@@ -114,7 +114,7 @@ io: any = require("./io")
@@ -129,7 +129,7 @@ network: any = require("./network")
@@ -144,7 +144,7 @@ system: any = require("./system")
@@ -159,7 +159,7 @@ version: any = version
diff --git a/lib/io.js b/lib/io.js
index ed128ab..41f474c 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -21,15 +21,11 @@ class IOUtils {
if (basepath) {
filename = path.resolve(basepath, originalFilename);
hasFile = fs.existsSync(filename);
+ /* istanbul ignore else */
if (hasFile) {
return filename;
}
}
- // Check if correct full path was passed.
- hasFile = fs.existsSync(filename);
- if (hasFile) {
- return filename;
- }
// Try running directory.
filename = path.resolve(process.cwd(), originalFilename);
hasFile = fs.existsSync(filename);
@@ -40,6 +36,12 @@ class IOUtils {
// Try application root path.
filename = path.resolve(path.dirname(require.main.filename), originalFilename);
hasFile = fs.existsSync(filename);
+ /* istanbul ignore if */
+ if (hasFile) {
+ return filename;
+ }
+ // Try local / absolute path.
+ hasFile = fs.existsSync(filename);
if (hasFile) {
return filename;
}
diff --git a/package-lock.json b/package-lock.json
index c97637b..dc84b14 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "jaul",
- "version": "1.0.3",
+ "version": "1.0.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -170,9 +170,9 @@
"dev": true
},
"@types/lodash": {
- "version": "4.14.134",
- "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.134.tgz",
- "integrity": "sha512-2/O0khFUCFeDlbi7sZ7ZFRCcT812fAeOLm7Ev4KbwASkZ575TDrDcY7YyaoHdTOzKcNbfiwLYZqPmoC4wadrsw==",
+ "version": "4.14.135",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.135.tgz",
+ "integrity": "sha512-Ed+tSZ9qM1oYpi5kzdsBuOzcAIn1wDW+e8TFJ50IMJMlSopGdJgKAbhHzN6h1E1OfjlGOr2JepzEWtg9NIfoNg==",
"dev": true
},
"@types/marked": {
diff --git a/package.json b/package.json
index 0a84893..2f45dd1 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "jaul",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "Just another utilities library. But a good one.",
"keywords": [
"jaul",
Static getFilePath
Static mkdirRecursive
Static sleep
Static getClientIP
Static getIP
Static getSingleIPv4
Static getSingleIPv6
Static ipInRange
Static getCpuLoad
Static getInfo
idle
total
labels
cpuCores
hostname
loadAvg
memoryTotal
memoryUsage
platform
process
title
uptime
Let index: object
data
io
network
system
version