-
Notifications
You must be signed in to change notification settings - Fork 108
Implement fpm publish
#876
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
Conversation
…s, get system tmp directory, read command line outputs
# Conflicts: # src/fpm/git.f90
# Conflicts: # src/fpm_command_line.f90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @minhqdao, looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@minhqdao Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @minhqdao , Looks good to me.
@@ -1020,4 +1021,65 @@ subroutine get_home(home, error) | |||
end if | |||
end subroutine get_home | |||
|
|||
!> Execute command line and return output as a string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be built into fortran just as execute_command_line
. I was searching whether we already have a routine implemented in fpm
but couldn't find any. Have I missed sth? @awvwgk @everythingfunctional @milancurcic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found any better method of capturing external command output in Fortran. I could potentially mention it to the standards committee.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be great if we had that.
!> Get system-dependent tmp directory. | ||
subroutine get_tmp_directory(tmp_dir, error) | ||
!> System-dependant tmp directory. | ||
character(len=:), allocatable, intent(out) :: tmp_dir | ||
!> Error to handle. | ||
type(error_t), allocatable, intent(out) :: error | ||
|
||
tmp_dir = get_env('TMPDIR', '') | ||
if (tmp_dir /= '') then | ||
tmp_dir = tmp_dir//'fpm'; return | ||
end if | ||
|
||
tmp_dir = get_env('TMP', '') | ||
if (tmp_dir /= '') then | ||
tmp_dir = tmp_dir//'fpm'; return | ||
end if | ||
|
||
tmp_dir = get_env('TEMP', '') | ||
if (tmp_dir /= '') then | ||
tmp_dir = tmp_dir//'fpm'; return | ||
end if | ||
|
||
call fatal_error(error, "Couldn't determine system temporary directory.") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this actually. @awvwgk @everythingfunctional @milancurcic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is built in.
error stop "Couldn't ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me as well
Implement api for publishing a package to the registry.
fpm_publish_settings
andfpm_cmd_publish
module.--show-form-data
instead of publishing.--show-version
instead of publishing.git
dependencies.git archive
.git archive -l
and use available method.curl
.How to test
Run
fpm publish --show-package-version
to print the package version to the console.Run
fpm publish --show-form-data
to print the form data to the console that would otherwise be sent throughfpm publish --token <token>
. If you include the token (fpm publish --token <token> --show-form-data
), the token will be included in the form data.Get a (test) token from the registry website and run
fpm publish --token <token>
to publish a package to the (test) registry.