mirror of
				https://github.com/Dadido3/go-typst.git
				synced 2025-11-04 05:09:35 +00:00 
			
		
		
		
	Allow it to compile on unsupported platforms
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	
This commit is contained in:
		
							parent
							
								
									bd9c1beac7
								
							
						
					
					
						commit
						bc69f35948
					
				
							
								
								
									
										6
									
								
								cli.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								cli.go
									
									
									
									
									
								
							@ -30,6 +30,9 @@ func (c CLI) VersionString() (string, error) {
 | 
			
		||||
	if c.ExecutablePath != "" {
 | 
			
		||||
		execPath = c.ExecutablePath
 | 
			
		||||
	}
 | 
			
		||||
	if execPath == "" {
 | 
			
		||||
		return "", fmt.Errorf("go-typst doesn't support this platform")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	cmd := exec.Command(execPath, "--version")
 | 
			
		||||
	cmd.Dir = c.WorkingDirectory // This doesn't do anything, but we will do it anyways for consistency.
 | 
			
		||||
@ -64,6 +67,9 @@ func (c CLI) Compile(input io.Reader, output io.Writer, options *CLIOptions) err
 | 
			
		||||
	if c.ExecutablePath != "" {
 | 
			
		||||
		execPath = c.ExecutablePath
 | 
			
		||||
	}
 | 
			
		||||
	if execPath == "" {
 | 
			
		||||
		return fmt.Errorf("go-typst doesn't support this platform")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	cmd := exec.Command(execPath, args...)
 | 
			
		||||
	cmd.Dir = c.WorkingDirectory
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								cli_js.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								cli_js.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
// Copyright (c) 2025 David Vogel
 | 
			
		||||
//
 | 
			
		||||
// This software is released under the MIT License.
 | 
			
		||||
// https://opensource.org/licenses/MIT
 | 
			
		||||
 | 
			
		||||
//go:build js
 | 
			
		||||
 | 
			
		||||
package typst
 | 
			
		||||
 | 
			
		||||
// The path to the Typst executable.
 | 
			
		||||
// We leave that empty as we don't support this platform for now.
 | 
			
		||||
var ExecutablePath = ""
 | 
			
		||||
							
								
								
									
										12
									
								
								cli_wasi.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								cli_wasi.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
// Copyright (c) 2025 David Vogel
 | 
			
		||||
//
 | 
			
		||||
// This software is released under the MIT License.
 | 
			
		||||
// https://opensource.org/licenses/MIT
 | 
			
		||||
 | 
			
		||||
//go:build wasip1
 | 
			
		||||
 | 
			
		||||
package typst
 | 
			
		||||
 | 
			
		||||
// The path to the Typst executable.
 | 
			
		||||
// We leave that empty as we don't support this platform for now.
 | 
			
		||||
var ExecutablePath = ""
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user