title: Why can't I access my file despite it being in the ressources?
body: <p>I am trying to open a JSON file in swift CLI in order to parse it.
  However, when I can't seem to generate a proper file URL despite the file being in the resources.</p>
  
  <pre><code>if let path = Bundle.main.path(forResource: "test", ofType: "json") {
      do {
          let fileUrl = URL(fileURLWithPath: path)
          print(fileUrl)
          let data = try Data(contentsOf: fileUrl, options: .mappedIfSafe)
          print(data)
          let cities: [City] = try decoder.decode([City].self, from: data);
          return cities;
      } catch {
          return nil;
      }
  }
  </code></pre>
  
  <p>If i open the "Build Phases" menu, I can see the test.json file inside, but swift can't access the file when I build.</p>
  
  <p>Thanks in advance for your help.</p>