Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Generating new playground not working #1

Closed
MysteryCoder456 opened this issue Jun 13, 2020 · 9 comments
Closed

Generating new playground not working #1

MysteryCoder456 opened this issue Jun 13, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@MysteryCoder456
Copy link

MysteryCoder456 commented Jun 13, 2020

SwiftPlaygroundsCLI Environment

  • SwiftPlaygroundsCLI version: 1.0.0
  • macOS version: 10.15.5
  • Xcode version: Version 11.5 (11E608c)
  • Installed via (mint, brew): brew

What did you do?

swiftplayground new test

What did you expect to happen?

Generate a new playground

What happened instead?

Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “BlankWithModules.playgroundbook” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Applications/Playgrounds.app/Contents/Resources/Templates/BlankWithModules.playgroundbook, NSUnderlyingError=0x7fe92860f4a0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

@SvenTiigi
Copy link
Owner

Hey @MysteryCoder456,

thanks for opening up an issue on SwiftPlaygroundsCLI.

It seems like the directory ~/Library/Mobile\ Documents/iCloud~com~apple~Playgrounds/Documents/ is missing.

A simple fix is to start the Playgrounds.app on your mac so that a Documents directory will be created in the iCloud container of the Playgrounds.app. After that you should be able to use SwiftPlaygroundsCLI.

I've just added a fix which will create the Documents directory if it is missing. It will be available within the next release of SwiftPlaygroundsCLI.

@SvenTiigi SvenTiigi added the bug Something isn't working label Jun 13, 2020
@SvenTiigi
Copy link
Owner

Please try it again with the latest release 1.0.2

@MysteryCoder456
Copy link
Author

Thanks for the reply and fix.

@MysteryCoder456
Copy link
Author

Sadly that didn't work. The Playgrounds folder is already there but the error is happening anyway.

@SvenTiigi
Copy link
Owner

I've just reproduced it and the version 1.0.2 fixes that problem.
Could you ensure you are running version 1.0.2.
Bildschirmfoto 2020-06-13 um 12 13 05

@MysteryCoder456
Copy link
Author

I've upgraded to 1.0.2 and still getting the same error. Also, running swiftplaygrounds --version shows Version 1.0.0 even thoough I upgraded to 1.0.2.

@SvenTiigi
Copy link
Owner

Yes you are correct. The version has not been properly updated when initializing SwiftCLI.
This will be fixed with the next release.

If the problem still exists please try to re-install the Playgrounds.app from the Mac AppStore and ensure the following file exists:

/Applications/Playgrounds.app/Contents/Resources/Templates/BlankWithModules.playgroundbook

And a documents directory is created in the iCloud container of the Playgrounds.app

~/Library/Mobile Documents/iCloud~com~apple~Playgrounds/Documents/

@MysteryCoder456
Copy link
Author

Oh, you need the Playgrounds app? I thought this was usable without any apps, that's why I installed it in the first place XD.

@SvenTiigi
Copy link
Owner

Correct you need the Playgrounds.app from the Mac AppStore 👍
I will update the Installation section in the ReadMe to clarify the installation requirements.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants