Open mvayngrib opened 8 years ago
It depends what you're trying to achieve? If you're trying to input a long path into a short directory then you're going to see an error, if you'll forgive my use of non-standard coding jargon regarding this particular instance which is actually the best way to describe it at the moment.
@GranularDetective not sure what you mean...i'm just talking about access privileges
Oh. Why do you want to sudo again? I suppose true root is much more enjoyable but in an actual coding sense what do you mean exactly?
On 1 March 2016 at 10:58, Mark Vayngrib notifications@github.com wrote:
@GranularDetective https://github.com/GranularDetective not sure what you mean...i'm just talking about access privileges
— Reply to this email directly or view it on GitHub https://github.com/dthree/vorpal/issues/122#issuecomment-190665160.
Why don't you want to sudo again, rather. Muh bad.
On 1 March 2016 at 11:10, Peter Carter peter.carter.mail@gmail.com wrote:
Oh. Why do you want to sudo again? I suppose true root is much more enjoyable but in an actual coding sense what do you mean exactly?
On 1 March 2016 at 10:58, Mark Vayngrib notifications@github.com wrote:
@GranularDetective https://github.com/GranularDetective not sure what you mean...i'm just talking about access privileges
— Reply to this email directly or view it on GitHub https://github.com/dthree/vorpal/issues/122#issuecomment-190665160.
@mvayngrib agreed. We just need a cross-platform temp dir. I think I implemented this in wat anyways, before I added localstorage to Vorpal.
Should be a pretty easy fix.
@dthree if you don't end up separating it out of wat, there's user-home and home-or-tmp
You added local storage to Vorpal? To wat purpose? On 1 Mar 2016 17:16, "dc" notifications@github.com wrote:
@mvayngrib https://github.com/mvayngrib agreed. We just need a cross-platform temp dir. I think I implemented this in wat https://github.com/dthree/wat anyways, before I added localstorage to Vorpal.
Should be a pretty easy fix.
— Reply to this email directly or view it on GitHub https://github.com/dthree/vorpal/issues/122#issuecomment-190818855.
Okay thanks.
os.tmpdir()
works fine.
Fixed in v1.10.7
.
I know this is an old issue, but I just found it, while trying to figure out where this was stored.
I think using os.tmpdir()
isn't a good idea, as, on some OSs (like Linux), this may default to a volatile directory. These files may not persist after a reboot.
I think the original suggestion of it being somewhere in the home directory is better. There's frequently a .cache
directory in $HOME. That's where, e.g., yarn
stores its module cache.
For reference, this is how yarn does it:
function getDirectory(category: string): string {
// use %LOCALAPPDATA%/Yarn on Windows
if (process.platform === 'win32' && process.env.LOCALAPPDATA) {
return path.join(process.env.LOCALAPPDATA, 'Yarn', category);
}
// otherwise use ~/.{category}/yarn
return path.join(userHome, `.${category}`, 'yarn');
}
function getCacheDirectory(): string {
if (process.platform === 'darwin') {
return path.join(userHome, 'Library', 'Caches', 'Yarn');
}
return getDirectory('cache');
}
So, getCacheDirectory()
returns $HOME/.cache/yarn
on Linux, %LOCALAPPDATA%\Yarn\cache
on Windows, and $HOME/Libarary/Caches/Yarn
on macOS.
I think something like that would be a good option for vorpal.
i ran into a problem when trying out your cash project. With my nodejs/npm setup, global installs require sudo:
sudo npm i -g cash
however, because of that, cash doesn't have permissions to write to its own localstorage directory:
obviously i don't want to run cash with sudo :)
isn't it more typical to put this kind of storage in ~/.vorpal or ~/.cash or somewhere else under
$HOME
?