hide ~/.vsce in windows

fix #1
This commit is contained in:
João Moreno 2015-09-29 17:53:16 +02:00
parent c9eae35d89
commit fd32996fc1

View file

@ -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<IStore> {
function save(store: IStore): Promise<IStore> {
return nfcall<void>(fs.writeFile, storePath, JSON.stringify(store))
.then(() => {
if (process.platform !== 'win32') {
return resolve(null);
}
return nfcall(exec, `attrib +H ${ storePath }`);
})
.then(() => store);
}