@@ -20,22 +20,25 @@ def __init__(self, *args, **kwargs):
2020 super ().__init__ (* args , ** kwargs )
2121
2222 def post_build (self , manager ):
23+ lite_dir = manager .lite_dir
24+ output_dir = manager .output_dir
25+
2326 cockleTool = Path ("node_modules" , "@jupyterlite" , "cockle" , "lib" , "tools" , "prepare_wasm.js" )
2427 if not cockleTool .is_file ():
2528 cockleTool = ".cockle_temp" / cockleTool
2629 cmd = ["npm" , "install" , "--no-save" , "--prefix" , cockleTool .parts [0 ], "@jupyterlite/cockle" ]
2730 print ("TerminalAddon:" , " " .join (cmd ))
28- subprocess .run (cmd , check = True )
31+ subprocess .run (cmd , check = True , cwd = lite_dir )
2932
30- assetDir = Path ( self . manager . output_dir ) / "extensions" / "@jupyterlite" / "terminal" / "static" / "wasm"
33+ assetDir = output_dir / "extensions" / "@jupyterlite" / "terminal" / "static" / "wasm"
3134
3235 # Although cockle's prepare_wasm is perfectly capable of copying the wasm and associated
3336 # files to the asset directory, here we just get the list of required files and let the
3437 # add-on do the copying for consistency with other extensions.
35- tempFilename = 'cockle-files.txt'
36- cmd = ["node" , str (cockleTool ), "--list" , tempFilename ]
38+ tempFilename = lite_dir / 'cockle-files.txt'
39+ cmd = ["node" , str (cockleTool ), "--list" , str ( tempFilename ) ]
3740 print ("TerminalAddon:" , " " .join (cmd ))
38- subprocess .run (cmd , check = True )
41+ subprocess .run (cmd , check = True , cwd = lite_dir )
3942
4043 with open (tempFilename , 'r' ) as f :
4144 for source in f :
@@ -44,7 +47,7 @@ def post_build(self, manager):
4447 packageName = next (f ).strip ()
4548 yield dict (
4649 name = f"copy:{ basename } " ,
47- actions = [(self .copy_one , [source , assetDir / packageName / basename ])],
50+ actions = [(self .copy_one , [lite_dir / source , assetDir / packageName / basename ])],
4851 )
4952
5053 os .remove (tempFilename )
0 commit comments