LoginSignup
1
1

More than 5 years have passed since last update.

Atomパッケージの公開を撤回&色々無かったことにする

Last updated at Posted at 2019-02-15

久々にAtomのパッケージを更新しようとしたら手間取ったので、やり方を記しておきます。
以前した投稿パッケージ(Atomでパッケージを公開・更新する)を例にやっていきます。

参考:Atomパッケージをアンパブリッシュする | To Be Decided

不完全なままcommit&push&apm publishしてしまった!!!!!!!!!

(パッケージを更新して再インストールしようとしたら、出来なくなってたので確定スリーアウト状態に)

atom.io
スクリーンショット 2019-02-14 16.48.46.png
github
スクリーンショット 2019-02-14 16.35.48.png

公開中のパッケージのバージョンを下げたい!!!
最新のコミット2つ(apm publishの自動コミットと己のコミット)を無かったことにしたい!!!!!!

環境

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.2
BuildVersion:   18C54
$ atom -v
Atom    : 1.34.0
Electron: 2.0.16
Chrome  : 61.0.3163.100
Node    : 8.9.3

作業手順

パッケージの公開を撤回する

# apm unpublish (name)@(version) 
$ apm unpublish latex-itemizer@0.1.0
Are you sure you want to unpublish 'latex-itemizer@0.1.0'? (no) yes # ここで入力
Unpublishing latex-itemizer@0.1.0 ✓

スクリーンショット 2019-02-14 16.47.44.png

これで指定したバージョンは非公開になる。

作業場所を一回綺麗に


$ cd /Users/aaa/.atom/packages
$ apm uninstall latex-itemizer
Uninstalling latex-itemizer 
$ git clone https://github.com/horyu/latex-itemizer.git
Cloning into 'latex-itemizer'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 38 (delta 2), reused 7 (delta 2), pack-reused 31
Unpacking objects: 100% (38/38), done.
$ cd latex-itemizer/
# 状態を確認
$ git log
commit f1f41164d169082787b26e60bcf0cb6bdff0762f (HEAD -> master, tag: v0.1.0, origin/master, origin/HEAD)
Author: horyu <horyu@users.noreply.github.com>
Date:   Thu Feb 14 16:09:06 2019 +0900

    Prepare 0.1.0 release

commit b9a06bbd2956ab7ee745b2466c5cfdb24ce8f798
Author: horyu <horyu@users.noreply.github.com>
Date:   Thu Feb 14 16:01:42 2019 +0900

    update dependencies

commit 7b54d3ea62081ba6ccbb36152d0bc0c677d4bfab
Author: horyu <horyu@users.noreply.github.com>
Date:   Thu Feb 14 14:13:30 2019 +0900

    tweak newline-itemize

commitを無かったことにする(リモートも)

## 2個戻したいので HEAD~~
$ git reset --hard HEAD~~
HEAD is now at 7b54d3e tweak newline-itemize
$ git log
commit 7b54d3ea62081ba6ccbb36152d0bc0c677d4bfab (HEAD -> master, origin/master, origin/HEAD)
Author: horyu <horyu@users.noreply.github.com>
Date:   Thu Feb 14 14:13:30 2019 +0900

    tweak newline-itemize
# (略)
# リモートに反映させる
$ git push -f
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/horyu/latex-itemizer.git
 + f1f4116...7b54d3e master -> master (forced update)

スクリーンショット 2019-02-14 16.44.30.png

tagを削除する

スクリーンショット 2019-02-14 17.00.35.png

$ git tag
v0.0.1
v0.0.2
v0.1.0
# ローカルのタグを削除 git tag -d (tagname)
$ git tag -d v0.1.0
Deleted tag 'v0.1.0' (was 4314c61)
# タグの更新をリモートに反映 git push origin :(tagname)
$ git push origin :v0.1.0
To https://github.com/horyu/latex-itemizer.git
 - [deleted]         v0.1.0

スクリーンショット 2019-02-14 17.10.19.png

以上

注意

最初の参考ページの最後に書かれているが、Atomのパッケージは~/.atom/.apm/latex-itemizer/0.1.0/package.tgzのようにキャッシュされている。

  • パッケージをunpublishする前に、あるユーザーがインストールしてしまっていた
  • 作者がパッケージをunpublishしたのと同じバージョンでpublishした

という場合に、あるユーザーはキャッシュを削除しなければ、新しくpublishされた方にパッケージを更新できなくなる。(なので、同じバージョンは使わず、バージョンは上げていきましょう)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1