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

Register unpublish cli command to the console #4995

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

awongCM
Copy link

@awongCM awongCM commented Jun 11, 2022

What does it do?

As a long time user of Octopress static site generator, I'm porting one of its useful commands, unpublish over there to here.

The explanation is simple - unpublish will move any published posts from _posts folder back to the _drafts folder. This is the reverse operation of publish command.

I find this old command feature from Octopress is useful a lot so I thought it would make good use case to have it for Hexo's counterpart. :)

Here's the original Ruby source for it - https://github.com/octopress/octopress/blob/master/lib/octopress/commands/unpublish.rb#L27
and
https://github.com/octopress/octopress/blob/af048361405919605d50fc45e2e1fd0c7eb02703/lib/octopress/post.rb#L37

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@github-actions

This comment was marked as outdated.

@awongCM
Copy link
Author

awongCM commented Jun 19, 2022

👇 Can someone please help with the open CI/CD failures ie all 13 of them?

Where do I start in resolving these failures so they all get passed?

Thanks!

@yoshinorin yoshinorin mentioned this pull request Aug 30, 2022
2 tasks
@stevenjoezhang
Copy link
Member

Some tests may fail due to race conditions:

1) Hexo
       Console
         unpublish
           rename if target existed:
     Error: ENOENT: no such file or directory, unlink '/Users/runner/work/hexo/hexo/test/scripts/console/unpublish_test/source/_posts/Hello-World.md'

Do we need to fix them?

@yoshinorin
Copy link
Member

yoshinorin commented Nov 25, 2022

@stevenjoezhang

Do we need to fix them?

I think NO. Sorry, I don't know.

But, one of the reasons why I don't approve and merge this PR is I can't understand how to use this command. I pull this PR to my local machine and tried to use it for review. I spent around 1h for try-and-error. Finally, I gave up.

Honestly, I also don't know the publish command (I have never been using publish command).

@awongCM
Copy link
Author

awongCM commented Dec 5, 2022

Some tests may fail due to race conditions:

1) Hexo
       Console
         unpublish
           rename if target existed:
     Error: ENOENT: no such file or directory, unlink '/Users/runner/work/hexo/hexo/test/scripts/console/unpublish_test/source/_posts/Hello-World.md'

Do we need to fix them?

Hi there,

Sorry. I'm just catching up on my old PR that's been left open for over 6 months.

Can you help me to point out where the errors are failing so I can find and fix them?

Thanks.

@stevenjoezhang
Copy link
Member

@awongCM You can check these failed tests: https://github.com/hexojs/hexo/actions/runs/3619487925/jobs/6127574239

@awongCM
Copy link
Author

awongCM commented Dec 7, 2022

@awongCM You can check these failed tests: https://github.com/hexojs/hexo/actions/runs/3619487925/jobs/6127574239
Thanks @stevenjoezhang

I realised where my mistake was... I forgot to follow the contribution guidelines of the npm test before submitting. My bad! 🤦

I will get this sorted asap.

@stevenjoezhang stevenjoezhang changed the title Register unplublish cli command to the console Register unpublish cli command to the console Mar 7, 2023
@stevenjoezhang stevenjoezhang changed the base branch from master to v7.0.0 July 9, 2023 17:36
@yoshinorin yoshinorin mentioned this pull request Jul 10, 2023
2 tasks
@stevenjoezhang stevenjoezhang changed the base branch from v7.0.0 to master October 25, 2023 05:02
@uiolee uiolee added the javascript Pull requests that update Javascript code label Jan 12, 2024
Copy link

How to test

git clone -b unplublish-cli https://github.com/awongCM/hexo.git
cd hexo
npm install
npm test

@awongCM
Copy link
Author

awongCM commented Apr 29, 2024

Hi @stevenjoezhang

Sorry, it's taken a while to get failed test suite fixed. 2023 was a crazy year for me..

npm test ran successfully for all tests.

Can you please if it's all okay on your end and can be approved for merge, assuming the above merge conflicts can be done by someone else?

@awongCM
Copy link
Author

awongCM commented Jun 29, 2024

Hi @stevenjoezhang

Sorry, it's taken a while to get failed test suite fixed. 2023 was a crazy year for me..

npm test ran successfully for all tests.

Can you please if it's all okay on your end and can be approved for merge, assuming the above merge conflicts can be done by someone else?

Hi

I'm just following on this. Any update or feedback you can provide? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants