Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Env Variables for DataDir and ExtensionDir #49306

Closed
daviduuang opened this issue May 6, 2018 · 4 comments
Closed

Need Env Variables for DataDir and ExtensionDir #49306

daviduuang opened this issue May 6, 2018 · 4 comments
Assignees
Labels
api *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Milestone

Comments

@daviduuang
Copy link

Currently, we can only get a few env variables when refer to the mannual here.
So other extensions may access the path of extension and data dir in their code like this:

let settingsPath = path.join(process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE, 'commandbar.json');

And we can run vscode with command-line parameters here.

If we specify the following options(for example, we can make it portable), we may change the extension and data dir settings.

--extensions-dir <dir> Set the root path for extensions.
--user-data-dir <dir> Specifies the directory that user data is kept in, useful when running as root.

But other extensions cann't realize the changes, so it may fails. This issue may be solved when env variables of extension-dir and data-dir exposed.


VSCode v1.23.0 x64(on Win10)

@shanalikhan
Copy link

I need to support Settings Sync as portable mode.
It would be great if you guys just expose these paths, currently i'm looking to solution that is not feasible though but will work

@tmeckel
Copy link

tmeckel commented Nov 22, 2018

Settings sync doesn't still work with VSCode when the --user-data-dir= command line parameter is used.

Error: ENOENT: no such file or directory, stat 'C:\Users\ee022a6\AppData\Roaming\Code'
	at fs.statSync (fs.js:954:11)
	at Object.fs.statSync (ELECTRON_ASAR.js:295:16)
	at Object.statSync (C:\Users\ee022a6\AppData\Local\Apps\VSCodePortable\Data\extensions\shan.code-settings-sync-3.2.0\node_modules\graceful-fs\polyfills.js:297:22)
	at new Environment (C:\Users\ee022a6\AppData\Local\Apps\VSCodePortable\Data\extensions\shan.code-settings-sync-3.2.0\out\src\environmentPath.js:114:24)
	at Sync.<anonymous> (C:\Users\ee022a6\AppData\Local\Apps\VSCodePortable\Data\extensions\shan.code-settings-sync-3.2.0\out\src\sync.js:32:25)
	at Generator.next (<anonymous>)
	at C:\Users\ee022a6\AppData\Local\Apps\VSCodePortable\Data\extensions\shan.code-settings-sync-3.2.0\out\src\sync.js:7:71
	at new Promise (<anonymous>)
	at __awaiter (C:\Users\ee022a6\AppData\Local\Apps\VSCodePortable\Data\extensions\shan.code-settings-sync-3.2.0\out\src\sync.js:3:12)
	at Sync.bootstrap (C:\Users\ee022a6\AppData\Local\Apps\VSCodePortable\Data\extensions\shan.code-settings-sync-3.2.0\out\src\sync.js:31:16)
	at C:\Users\ee022a6\AppData\Local\Apps\VSCodePortable\Data\extensions\shan.code-settings-sync-3.2.0\out\src\extension.js:18:14
	at Generator.next (<anonymous>)
	at fulfilled (C:\Users\ee022a6\AppData\Local\Apps\VSCodePortable\Data\extensions\shan.code-settings-sync-3.2.0\out\src\extension.js:4:58)
	at <anonymous>

@jrieken jrieken added this to the Backlog milestone Jan 13, 2020
@jrieken
Copy link
Member

jrieken commented Nov 10, 2020

/duplicate of #2741

@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

6 participants
@joaomoreno @jrieken @daviduuang @shanalikhan @tmeckel and others