JohnSundell / Marathon

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

Getting "Failed to open script 'helloWorld' for editing" #140

Closed everlof closed 7 years ago

everlof commented 7 years ago

MacOS: 10.12.6 (16G29) Marathon version: 1.0.1

After installing with brew:

$ marathon create helloWorld "import Foundation; print(\"Hello world\")" --verbose
🐣  Created script at helloWorld.swift
🏃  $ cd "/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld/.build/" && ln -s "/Users/daveve/.marathon/Packages/Generated/.build/checkouts/" "checkouts"

   $ cd "/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld/.build/" && ln -s "/Users/daveve/.marathon/Packages/Generated/.build/repositories/" "repositories"

   $ cd "/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld/" && ln -s "/Users/daveve/uppd/helloWorld.swift" "OriginalFile"

   $ cd "/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld/" && readlink OriginalFile
   /Users/daveve/uppd/helloWorld.swift
   $ cd "/Users/daveve/uppd/" && /usr/bin/env xcrun --sdk macosx swift --version
   Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
   Target: x86_64-apple-macosx10.9
   $ cd "/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld/" && /usr/bin/env xcrun --sdk macosx swift package generate-xcodeproj
   error: package at '/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld' requires a minimum Swift tools version of 4.0.2 (currently 4.0.0)
💥  Failed to open script 'helloWorld' for editing
👉  Make sure that it exists and that its file is readable
👎  [last: 0s] 11:46:23 ~/uppd 
$ marathon edit helloWorld.swift --verbose
🏃  $ cd "/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld/" && readlink OriginalFile
   /Users/daveve/uppd/helloWorld.swift
   $ cd "/Users/daveve/uppd/" && /usr/bin/env xcrun --sdk macosx swift --version
   Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
   Target: x86_64-apple-macosx10.9
   $ cd "/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld/" && /usr/bin/env xcrun --sdk macosx swift package generate-xcodeproj
   error: package at '/Users/daveve/.marathon/Scripts/Cache/-Users-daveve-uppd-helloWorld' requires a minimum Swift tools version of 4.0.2 (currently 4.0.0)
💥  Failed to open script 'helloWorld' for editing
👉  Make sure that it exists and that its file is readable

It's there, and it's readable:

$ ls -la
total 1102732
drwxr-xr-x   8 daveve staff        272 Nov  5 11:35 .
drwxr-xr-x+ 99 daveve staff       3366 Nov  5 10:11 ..
-rw-r--r--   1 daveve staff       8196 Oct 23 16:23 .DS_Store
-rw-r--r--   1 daveve staff         39 Nov  5 11:35 helloWorld.swift
...
dabrut commented 7 years ago

The issue is the same as this one https://github.com/JohnSundell/Marathon/issues/137

JohnSundell commented 7 years ago

Fixed! Will submit a new version to Homebrew ASAP, in the meantime you can install the latest master go get around this problem 👍 Thanks for reporting it @everlof 🙏