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

Wrong absolute paths #168

Closed
mmjvox opened this issue Jun 25, 2022 · 5 comments
Closed

Wrong absolute paths #168

mmjvox opened this issue Jun 25, 2022 · 5 comments

Comments

@mmjvox
Copy link

mmjvox commented Jun 25, 2022

Im using cmake to generate font in build steps, cmake fills the input and output directories.
There is no problem with cmake commands, This program (svgtofont) goes wrong with absolute paths.

cmake definitions:

set(SVG_ICONS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources/svgFont/svg)
set(FONTICONS_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_font)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/svgFont/package.json.in ${CMAKE_CURRENT_BINARY_DIR}/package.json)

package.json.in file:

//  /home/.../project/fonts/package.json.in
"scripts": {
    "font": "svgtofont --sources @SVG_ICONS_DIR@ --output @FONTICONS_OUTPUT_DIR@"
  }

generated package.json file:

//   /home/.../project_build/fonts/package.json
"scripts": {
    "font": "svgtofont --sources  /home/.../project/fonts/svg --output  /home/.../project_build/generated_font"
  }

error:

The directory does not exist! /home/.../project_build/home/.../project/fonts/svg

It appends input path to running path ( the result is someting like this /home/.../project_build/home/.../project/fonts/svg)

A real example:

[user1@fedora GUI]$ npm run font

> font
> svgtofont --sources /home/user1/projects/MainApp/plugins/GUI/resources/svgFont/svg --output /home/user1/builds/build-MainApp-Desktop_Qt_5_15_2_GCC_64bit-Debug/plugins/GUI/generated_font

The directory does not exist! /home/user1/builds/build-MainApp-Desktop_Qt_5_15_2_GCC_64bit-Debug/plugins/GUI/home/user1/projects/MainApp/plugins/GUI/resources/svgFont/svg

I even tested it without cmake and it still had this problem.

@jaywcjlove
Copy link
Owner

@mmjvox The directory does not exist!

@mmjvox
Copy link
Author

mmjvox commented Jun 25, 2022

Of course, it is clear that this directory does not exist. 😁😀
Both of --sources and --output directories are exists.
But it is not clear why looks for the wrong path that does not exist

I updated my description.

@jaywcjlove
Copy link
Owner

I have no way of knowing the reason for your error.
@mmjvox

@exil
Copy link

exil commented Nov 15, 2022

I am also running into this issue. I want to supply an absolute path to `--sources``, but when I do, it appends the path to the current working directory.

The code is here:

const sourcesPath = path.join(process.cwd(), argv.sources);

Here the --sources value is appended to the current directory, which means that it is not possible to give an absolute path to --sources and --output. Is there perhaps a workaround for this?

jaywcjlove added a commit that referenced this issue Nov 15, 2022
@jaywcjlove
Copy link
Owner

@exil Thank you for your explanation, I get it. I fixed it

Upgrade v3.20.0

jaywcjlove added a commit that referenced this issue Nov 15, 2022
jaywcjlove added a commit that referenced this issue Nov 15, 2022
@mmjvox mmjvox closed this as completed Feb 1, 2023
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

3 participants