Wrong absolute paths
See original GitHub issueIm 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.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Auto imported file path is wrong (absolute vs relative ... - GitHub
When I try to automatically import something from server/shared/constants.ts to server/validators/file.ts the import string is: import { ...
Read more >What is the difference between a relative and absolute path?
Information on the differences between a relative and absolute path.
Read more >Incorrect Absolute File Path - java - Stack Overflow
What you have done is creating a File object representing the file "GameDatabase.csv" in the current working directory (this file does not exist) ......
Read more >"Error: Detected an absolute file path. Paths starting with '/' are ...
SOLUTION. To solve this, users need to use a relative path instead of an absolute path. This means that the reference is no...
Read more >Relative and absolute paths, in the file system and on the web ...
If the path is built starting from the system root, it is called absolute. If the path is built starting from the current...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@exil Thank you for your explanation, I get it. I fixed it
Upgrade
v3.20.0
I have no way of knowing the reason for your error. @mmjvox