Repository navigation
How to tell tx where to download the files? #171
Description
Activity
So, what is the difference between
--root-configand--config?The root configuration holds your API token for interacting with transifex while the local configuration holds your project's setup, ie which remote resources map to which local files (and what file format they use and potential language mappings etc). The reason for this distinction is that local configurations can be committed to your version control system and thus shared with other teammates while API tokens shouldn't.
If you don't use the
--root-configand/or--configflags, then the root configuration will be read from~/.transifexrc(in Linux/MacOS systems) and the local configuration will be read from./.tx/config. You can use these flags to override the paths.It seems that i'm forced to run
txin the same directory as the.txdirectory or what am i doing wrong?It seems you are correct. We don't have a way to override the "working directory" of the application. So you will need to
cdinto your project's directory before running the command. We could look into bringing the--rootflag back (although if we did I would propose renaming it to--pwdor--cwdor something like that) but we would have to measure its importance. For example, would not having this flag break your workflow? Are you aware of other similar tools that do have this option?So you will need to cd into your project's directory before running the command.
As a workaround you can edit the ./.tx/config file manually. Just add the full absolute target path to the lines
file_filterandsource_file, then tx client will write and read it's output and input files from and to the desired directories, regardless from where it was called. (You'll have to create the needed subdirectories manually beforehand in this case, otherwise tx client hangs forever on execution.) If you don't want to modify your original config, just copy it to config-temp, modify the -temp copy of the config file and run tx with-c '/path/to/config-temp'option.We could look into bringing the --root flag back (although if we did I would propose renaming it to --pwd or --cwd or something like that) but we would have to measure its importance.
If asked, I'd consider such a flag useful for temporary out of default workflow testing and checking translations without touching current state of default local copy by redirecting them to another directory. But as said, the same can be achieved by the described workaround as well.
In the old
txi used:/usr/local/bin/tx --root /home/username/lang/convert pull -aand the files was downloaded in to a directory calleden_examplexmlfull path/home/username/lang/convert/en_examplexmland it doesn't matter where i ran the tx command from.In this new version i run
tx --config /home/username/lang/convert/.tx/config pull -a, but this new version will create the directoryen_examplexmlin the same directory i run tx from and download the files in toen_examplexml.I have tried to use
--root-config, but it want a file and not a directory.If i add the path to the config after --root-config file it tell me that i need to run
tx init.So, what is the difference between
--root-configand--config?It seems that i'm forced to run
txin the same directory as the.txdirectory or what am i doing wrong?