JohnSundell / Marathon

[DEPRECATED] Marathon makes it easy to write, run and manage your Swift scripts 🏃
MIT License
1.86k stars 78 forks source link

Can't edit files #119

Closed codeOfRobin closed 7 years ago

codeOfRobin commented 7 years ago

I tried running marathon edit createSession and it says.

💥  Failed to open script 'createSession' for editing
👉  Make sure that it exists and that its file is readable

I can verify that the file exists, and marathon edit createSession --no-xcode seems to work.

JohnSundell commented 7 years ago

Hey @codeOfRobin 👋 Could you run marathon edit createSession --verbose and post the output here, so that we can start debugging the issue?

codeOfRobin commented 7 years ago

👋 Running with verbose gives me

🏃  $ cd "/Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/" && readlink OriginalFile
   /Users/robinmalhotra/Developer/scripts/createSession.swift
   $ cd "/Users/robinmalhotra/Developer/scripts/" && /usr/bin/env xcrun --sdk macosx swift --version
   Apple Swift version 4.0 (swiftlang-900.0.63.10 clang-900.0.36)
   Target: x86_64-apple-macosx10.9
   $ cd "/Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/" && /usr/bin/env xcrun --sdk macosx swift package generate-xcodeproj
   error: package has unsupported layout; found loose source files: /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/DELETETests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/Dictionary+FormURLEncodedTests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/DownloadTests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/GETTests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/JSONTests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/NetworkingTests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/POSTTests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/PUTTests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/ResulTests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/SHA1.m, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/String+UTF8Tests.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/TestHelpers.swift, /Users/robinmalhotra/.marathon/Scripts/Cache/-Users-robinmalhotra-Developer-scripts-createSession/.build/checkouts/Networking.git--5313523778849338262/Tests/UnauthorizedCallbackTests.swift

Looks like it's an issue around SPM not quite liking his tests. We should probably inform Elvis about this.

JohnSundell commented 7 years ago

Looks like the framework you're trying to use does not have a Swift 4-compatible layout. As of Swift 4, all code needs to be contained in folders matching the various modules/targets of a Swift Package. So the framework needs to be updated to support Swift 4.

Marathon's error message could be better here of course.

codeOfRobin commented 7 years ago

Cool, thanks a lot! I'll speak to the project maintainer.