Closed felixsanz closed 9 months ago
cc @Daniel15
Yeah, we didn't fix the directory name in the tarball (https://github.com/yarnpkg/yarn/issues/431), and now people are probably relying on the fact it has a dist
directory so I'm not sure if we could change it 😕 The docs on the site were written for the ideal state of things.
I think your proposed solution is fine though (extracting to /opt/yarn
), would you like to send a pull request to update it?
So looks like you want the version number in the directory (i wouldn't do that).
This is how pretty much every piece of Linux software does it though. Try download the tarball of any Linux app and most likely it'll contain a directory with the app name and version number. Some examples of directory names in tarballs:
node-v6.9.1-linux-x64
php-7.0.12
vim80
@Daniel15 can change it in the next 0.x
release, better to do it now than later.
It is possible to also remove the dist
directory? It's the first level directory and everything is inside, so there is no point in having it inside the tarball. This way we avoid --strip-components=1
which is not a valid option on some versions on tar
(like the one shipping by default in alpine linux)
In general, all archives should have a top-level directory. It's normally done to avoid making a mess of the file system (eg. downloading an archive to /opt
or /usr/local
and then extracting it should put everything in a directory rather than directly extracting everything at the root level).
I could be wrong, but I don't know of any software package that ships tarballs without everything contained within a top-level directory.
So let's call it yarn
and not dist
. I agree most applications have a top level directory but they name the folder as the package being installed. This way we can unpack it into /opt
directly and it will create a /opt/yarn
hierarchy. /opt/dist
is weird (and even wrong). The same as with /opt/yarn/dist/
.
Two examples: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.10.tgz -> mongodb-linux-x86_64-3.2.10 http://www.aerospike.com/download/server/3.10.0.3/artifact/tgz -> aerospike-server
I've created a PR in #213 fixing the tar command but it's still wrong because if you do so, you get
/opt/dist/bin/yarn
which is probably incorrect since there is no scope.This can be fixed with
mkdir -p /opt/yarn
and passing-C /opt/yarn
totar
command, but i'm creating this issue because that's not how i think you want it.The docs say:
So looks like you want the version number in the directory (i wouldn't do that). So... discuss.
This is what i end doing:
and then
yarn
works.(Linux only)