create-unitypackage icon indicating copy to clipboard operation
create-unitypackage copied to clipboard

EISDIR: illegal operation on a directory, copyfile 'Assets/Directory/Subdirectory'

Open ArnauKokoro opened this issue 3 years ago • 4 comments

Hi, I'm trying to package a directory with subdirectories inside and it fails when trying to package these subdirectories.

Error: EISDIR: illegal operation on a directory, copyfile 'Assets/Directory/Subdirectory' -> 'tempFolderkI3Kww/archtemp/9c073fbaccbf4982bbbdb0d1dd95d098/asset' at Object.copyFileSync (fs.js:1907:3) at /home/runner/work/_actions/pCYSl5EDgo/create-unitypackage/master/node_modules/unitypackage/dist/index.js:72:30 at FSReqCallback.oncomplete (fs.js:156:23) { errno: -21, syscall: 'copyfile', code: 'EISDIR', path: 'Assets/Directory/Subdirectory', dest: 'tempFolderkI3Kww/archtemp/9c073fbaccbf4982bbbdb0d1dd95d098/asset'

If I try to package a directory with just files inside it works perfect but there are problems when it has subdirectories.

Many thanks!

ArnauKokoro avatar Jun 03 '22 15:06 ArnauKokoro

@pCYSl5EDgo I'm using this command to collect files:

find Assets/Directory -name \*.meta >> filesList

Inside that Directory there are folders and files with meta files.

Is there something wrong?

Thanks!

ArnauKokoro avatar Jun 05 '22 08:06 ArnauKokoro

I've digged around and found that some folder assets don't include folderAsset key.

Folder asset generated by Unity (through Unity's Project window or directory creation in background):

fileFormatVersion: 2
guid: feae48b6f9bfa403487f93efdbfd6f37
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData: 
  assetBundleName: 
  assetBundleVariant: 

Folder asset generated by JetBrains Rider (through right clicking Explorer pane):

fileFormatVersion: 2
guid: 67752b85c7144d728576d4fe78980202
timeCreated: 1664390072

This is the reason metaDatum.folderAsset !== "yes" check fails. Maybe we should accept a different way to detect a folder asset.

By the way, I came up here because this Action is used in vrchat-community/template-package, so congratulations! Also another thanks from me (I have yet to manage this to work though)

kaikoga avatar Sep 28 '22 19:09 kaikoga

Thank you for your digging. As it seemed enough for me to fix the issue, I changed some codes. I hope this version(current master is v1.1.1) will help you.

pCYSl5EDgo avatar Sep 29 '22 07:09 pCYSl5EDgo

Just have confirmed that I am now able to create a package from my personal project, which definitely contains a lot of subfolders made in JetBrains Rider.

I appreciate your quick fix and nice work!

Hope this also fixes @ArnauKokoro's issue.

kaikoga avatar Sep 30 '22 14:09 kaikoga

I close this issue because 1 year has passed and there seems no problem.

pCYSl5EDgo avatar Jan 02 '24 14:01 pCYSl5EDgo