Skip to content

TagSpaces is an offline, open source, document manager with tagging support

set the hidden attribute to .ts folders after creation

Ilian Sapundshiev3803fa7be6a2
diff --git a/app/reducers/app.js b/app/reducers/app.js
index 6b291b988..cee2a68a7 100644
--- a/app/reducers/app.js
+++ b/app/reducers/app.js
@@ -18,6 +18,7 @@
*/
import uuidv1 from 'uuid';
+import winattr from 'winattr';
import { type Location, locationType } from './locations';
import PlatformIO from '../services/platform-io';
import AppConfig from '../config';
@@ -571,6 +572,16 @@ export const actions = {
settings,
dispatch
);
+ // Make .ts a hidden folder under Windows
+ if (AppConfig.isWin && !PlatformIO.haveObjectStoreSupport()) {
+ winattr.set(metaDirectory, { hidden: true }, (err) => {
+ if (err) {
+ console.warn('Error setting hidden attr. to dir: ' + metaDirectory);
+ } else {
+ console.log('Success setting hidden attr. to dir: ' + metaDirectory);
+ }
+ });
+ }
return true;
})
.catch(() => {
diff --git a/package.json b/package.json
index bca4769f9..e47493383 100644
--- a/package.json
+++ b/package.json
@@ -233,7 +233,8 @@
"redux-thunk": "^2.2.0",
"remove-markdown": "^0.2.2",
"semver": "^5.5.0",
- "source-map-support": "^0.5.6"
+ "source-map-support": "^0.5.6",
+ "winattr": "^2.0.0"
},
"devEngines": {
"node": ">=8.x",
diff --git a/yarn.lock b/yarn.lock
index 1da3ed40a..9fbc331a4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5560,6 +5560,11 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10:
mkdirp ">=0.5 0"
rimraf "2"
+fswin@^2.16.1102:
+ version "2.17.1227"
+ resolved "https://registry.yarnpkg.com/fswin/-/fswin-2.17.1227.tgz#c598061e1ac1e7110e2e6ce884296efa27dc2507"
+ integrity sha512-xNDktvwzSsXT8Xqnpz59VbuFwGHhtn1w+dS7QQ+wAu5cbH0p3WMGKU9Duf7cPna+nubhR+5ZG1MTl6/V6xgRgw==
+
function-bind@^1.1.0, function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
@@ -13414,6 +13419,13 @@ widest-line@^2.0.0:
dependencies:
string-width "^2.1.1"
+winattr@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/winattr/-/winattr-2.0.0.tgz#553d4e347c8c598551a8d7032eefe36526bd5026"
+ integrity sha1-VT1ONHyMWYVRqNcDLu/jZSa9UCY=
+ dependencies:
+ fswin "^2.16.1102"
+
window-size@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876"