perryrh0dan / tmpo

Command line interface to create new workspaces based on templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

after_install on windows does not work as expected

nflaig opened this issue · comments

I have a template which has the npm install command in scripts.after_install. After running tmpo init and entering all the values the shell switched to cmd but no command is executed.

meta.json

{
  "kind": "template",
  "name": "lb4-module",
  "version": "0.1.0",
  "extend": ["lb4-default"],
  "scripts": {
    "before_install": "",
    "after_install": "npm install"
  }
}

should also be fixed in 1.5.2

the after_install script is now executed and running but there seems to be another issue related to copying the folder from the temp folder called .tmpw8PqPB in my case to the acutal location.

The error message is Access is denied. (os error 5)

as another sidenote: I noticed that husky failed to install because it seems like git is initialized after the after_install command is ran

image

as another sidenote: I noticed that husky failed to install because it seems like git is initialized after the after_install command is ran

image

Yes the git repository is initialized at the end. But should be no problem to do this before the templates are copied.

the after_install script is now executed and running but there seems to be another issue related to copying the folder from the temp folder called .tmpw8PqPB in my case to the acutal location.

The error message is Access is denied. (os error 5)

Mhhh thats strange on my machine thats working. Maybe you can have a look in the logs under /home/.tmpo/logs/output.log. Disclaimer loggin is in an early phase xD

the log file does not provide any further details but there is another issue which might be related.

Maybe it also has to do with the amount of files that are being copied

Mhh.. strange. I am actually thinking about how usefull the tempdir is. From one perspectiv its not bad to initialze everything in an temp directory and move after but the problem is that the os (linux/windows) dont suppot nativ temp dirs (only tempfile). That means that if the process is interrupted by e.g. a SIGTERM the temp dir is not deleted.

I tested now on two different windows systems with my default typescript template that worked. Can you maybe also have a test with this template.

I finalize a new release 1.5.3.
I add this lines in the init action to avoid workspace path like this /homes/thomas/./.tmp437832/2fa
My system had no problems with this but maybe this led to your problems.

  let dir = if workspace_directory != "." && workspace_directory != "./" {
    current_dir.join(workspace_directory)
  } else {
    current_dir
  };

I tested the default typescript template and it failed as well at first, then I tested the lb4-module template again and it suddenly worked...

I also updated to 1.5.3 and it worked again with the lb4-module template, I will let you know if I get the issue again and btw great updater 💯

the issue can probably be closed