Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected error requirement failed: Source file x is a directory #297

Closed
p41n1 opened this issue Sep 8, 2023 · 4 comments
Closed

Unexpected error requirement failed: Source file x is a directory #297

p41n1 opened this issue Sep 8, 2023 · 4 comments

Comments

@p41n1
Copy link
Contributor

p41n1 commented Sep 8, 2023

Hi,

I noticed that on my Linux machine installing of a course didn't work, since I was able to install the course on my windows I opened an issue here.

What I tried:

> cmtc install -f -s scalacenter/scala3-migration-course
Downloading studentified course from 'https://github.com/scalacenter/scala3-migration-course/releases/download/v0.1.1/scala3-migration-course-student.zip' to courses directory

ERROR - Failed to execute command.
  Unexpected error(requirement failed: Source file '/tmp/sbt_77588c2b/scala3-migration-course' is a directory.)
  /home/x/.cache/cmt/Courses/scala3-migration-course.zip may be corrupt

I investigated the source code a bit and found the following line to be the cause of the problem: https://github.com/lunatech-labs/course-management-tools/blob/main/cmtc/src/main/scala/com/lunatech/cmt/client/command/Install.scala#L84

If I replace the sbtio.move line with:

sbtio.copyDirectory(tmpDir / project, targetFolder)
sbtio.delete(tmpDir / project)

the installation works like a charm.

My question: Is this intended or a bug ?


Used version:

> cmtc version
name: Course Management Tools (Client), version: 2.0.19, scalaVersion: 3.3.0, sbtVersion: 1.9.3

> cs java -version
openjdk version "17.0.8.1" 2023-08-24
OpenJDK Runtime Environment (build 17.0.8.1+0-suse-1.1-x8664)
OpenJDK 64-Bit Server VM (build 17.0.8.1+0-suse-1.1-x8664, mixed mode, sharing)
@p41n1 p41n1 changed the title Unexpected error requirement: Source file x is a directory Unexpected error requirement failed: Source file x is a directory Sep 8, 2023
@eloots
Copy link
Collaborator

eloots commented Sep 15, 2023

Thanks for hunting this down!
I'll apply the suggested change.

@p41n1
Copy link
Contributor Author

p41n1 commented Oct 16, 2023

Hi,

thanks for applying the changes, I noticed the delete-call was missing and created a PR.

(Sorry it took so long.. I forgot about the issue)

@eloots
Copy link
Collaborator

eloots commented Oct 16, 2023

Resolved via #306 and #301

@eloots eloots closed this as completed Oct 16, 2023
@eloots
Copy link
Collaborator

eloots commented Oct 16, 2023

@p41n1 Release 2.0.22 contains the fix (including the one for the missing delete)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants