Skip to content

Commit 2f2e471

Browse files
committed
Include steps in help
1 parent 4aed890 commit 2f2e471

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

src/fpm/cmd/publish.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ subroutine cmd_publish(settings)
4444
print *, version%s(); return
4545
end if
4646

47-
! Build model to obtain dependency tree.
48-
call build_model(model, settings%fpm_build_settings, package, error)
49-
if (allocated(error)) call fpm_stop(1, '*cmd_build* Model error: '//error%message)
50-
5147
!> Checks before uploading the package.
5248
if (.not. allocated(package%license)) call fpm_stop(1, 'No license specified in fpm.toml.')
5349
if (.not. allocated(version)) call fpm_stop(1, 'No version specified in fpm.toml.')
5450
if (version%s() == '0') call fpm_stop(1, 'Invalid version: "'//version%s()//'".')
5551
if (.not. exists('fpm.toml')) call fpm_stop(1, "Cannot find 'fpm.toml' file. Are you in the project root?")
5652

53+
! Build model to obtain dependency tree.
54+
call build_model(model, settings%fpm_build_settings, package, error)
55+
if (allocated(error)) call fpm_stop(1, '*cmd_build* Model error: '//error%message)
56+
5757
! Check if package contains git dependencies. Only publish packages without git dependencies.
5858
do i = 1, model%deps%ndep
5959
if (allocated(model%deps%dep(i)%git)) then

src/fpm_command_line.f90

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,20 +1361,38 @@ subroutine set_help()
13611361
' publish(1) - publish package to the registry', &
13621362
'', &
13631363
'SYNOPSIS', &
1364-
' fpm publish [--token TOKEN]', &
1364+
' fpm publish [--token TOKEN] [--show-package-version] [--show-upload-data]', &
13651365
'', &
13661366
' fpm publish --help|--version', &
13671367
'', &
13681368
'DESCRIPTION', &
1369-
' Collect relevant source files and upload package to the registry.', &
1370-
' It is mandatory to provide a token. The token can be generated on the', &
1371-
' registry website and will be linked to your username and namespace.', &
1369+
' Follow the steps to create a tarball and upload the package to the registry:', &
1370+
'', &
1371+
' 1. Register on the website (https://registry-frontend.vercel.app/).', &
1372+
' 2. Create a namespace. Uploaded packages must be assigned to a unique', &
1373+
' namespace to avoid conflicts among packages with similar names. A', &
1374+
' namespace can accommodate multiple packages.', &
1375+
' 3. Create a token for that namespace. A token is linked to your username', &
1376+
' and is used to authenticate you during the upload process. Do not share', &
1377+
' the token with others.', &
1378+
' 4. Run fpm publish --token TOKEN to upload the package to the registry.', &
1379+
' But be aware that the upload is permanent. An uploaded package cannot be', &
1380+
' deleted.', &
1381+
'', &
1382+
' See documentation (https://fpm.fortran-lang.org/en/spec/publish.html) for', &
1383+
' more information regarding the package upload.', &
13721384
'', &
13731385
'OPTIONS', &
13741386
' --show-package-version show package version without publishing', &
13751387
' --show-upload-data show uploaded data without publishing', &
13761388
' --help print this help and exit', &
13771389
' --version print program version information and exit', &
1390+
'', &
1391+
'EXAMPLES', &
1392+
'', &
1393+
' fpm publish --show-package-version # show package version without publishing', &
1394+
' fpm publish --show-upload-data # show upload data without publishing', &
1395+
' fpm publish --token TOKEN # upload package to the registry using TOKEN', &
13781396
'' ]
13791397
end subroutine set_help
13801398

0 commit comments

Comments
 (0)