From fd32996fc161eecb3e7713065f56448d22769a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 29 Sep 2015 17:53:16 +0200 Subject: [PATCH] hide ~/.vsce in windows fix #1 --- src/store.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/store.ts b/src/store.ts index 359f72a..3bf5458 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,5 +1,6 @@ import * as fs from 'fs'; import * as path from 'path'; +import { exec } from 'child_process'; import { Promise, nfcall, resolve, reject } from 'q'; import { home } from 'osenv'; import { read, getGalleryAPI } from './util'; @@ -39,6 +40,13 @@ function load(): Promise { function save(store: IStore): Promise { return nfcall(fs.writeFile, storePath, JSON.stringify(store)) + .then(() => { + if (process.platform !== 'win32') { + return resolve(null); + } + + return nfcall(exec, `attrib +H ${ storePath }`); + }) .then(() => store); }