Search code examples
jsonwindowsmacosgithubdirectory-structure

Current Directory on Mac and Windows for json file


I need a help on my GitHub repository which needs to work on all systems. But current directory must be given on json file. Mac (with $(pwd)) and Windows (with %cd%) uses different values for that and are there any options so that works easily on both systems?


Solution

  • JSON is a static type file so you cannot have different for both. but what you can do is if you are processing it using something, you can store different keys for each OS and check which OS you are currently on and select your path accordingly.