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

Add a documentation for scoop export #1543

Closed
marek-hanzal opened this issue Jun 5, 2017 · 11 comments
Closed

Add a documentation for scoop export #1543

marek-hanzal opened this issue Jun 5, 2017 · 11 comments

Comments

@marek-hanzal
Copy link

There is description, how to do scoop export, but there is not easy way, how to do scoop import / install, whatever. I've tried somethings, but nothing worked.

So this issue is basically "How to import exported list of applications?".

Thanks :)

@mykolapolonskyi
Copy link

mykolapolonskyi commented Jun 15, 2017

Not sure put report here or somewhere else but: I have opened result of the export command and got this
image
in vi fom busybox package
probably its cp1251

@lukesampson
Copy link
Member

I'm not sure why scoop export exists, to be honest. It doesn't really do anything that scoop list doesn't already do, it just does it with different formatting. Probably best to treat it as deprecated and don't rely on it for anything.

Here's how I would do an export/import. You're not guaranteed to get the same versions of apps, just the same apps at the most recent version.

# export app names to scoop-apps.txt
(scoop list) | sls '^  (\w+)' |% { $_.matches.groups[1].value } > scoop-apps.txt

# install apps from scoop-apps.txt
$apps = gc scoop-apps.txt
scoop install @apps

@mykolapolonskyi that looks like an encoding problem. PowerShell I think uses a Unicode encoding (not UTF-8 though) and vi isn't detecting that. If you did scoop export | out-file test.txt -encoding ascii and open that in vi you should be okay. However, see comments above about not using scoop export.

@marek-hanzal
Copy link
Author

Ok, understand. And what about idea to use exported list of applications, including versions only to let user know on import, that there are newer versions of applications (as a notice/info)? Maybe it's not necessary as that's a concept of Scoop, so who is using it should expect that there could be newer versions...

@klauern
Copy link
Contributor

klauern commented Nov 2, 2017

@lukesampson I'm not getting that first command to work:

C:\Users\klauer
λ  (scoop list) | sls '^  (\w+)' |% { $_.matches.groups[1].value } > scoop-apps.txt
Installed apps:

  7zip 16.04
  android-studio 3.0.0.18 [extras]
  cacert 2017-09-20
  concfg 0.2017.6.17
  coreutils 5.97.3
  ctags 5.8
  curl 7.56.1
  ffmpeg 20171102-d5995c5
  fnproject 0.4.13
  fzf 0.17.1
  gawk 3.1.7
  git 2.15.0.windows.1
  gitignore 0.2015.08.26
  gitkraken 3.2.1 [extras]
  gow 0.8.0
  gradle 4.3
  graphviz 2.38
  greenshot 1.2.10.6 [extras]
  grep 2.5.4
  gvim 8.0 *global* [extras]
  hack-font 1.4.2 *global* [extras]
  hashcat 4.0.0
  heroku-cli nightly-20171022 [extras]
  hub 2.2.9
  hugo 0.30.2
  hyper 1.4.8 [extras]
  innounp 0.46
  insomnia 5.10.1 [extras]
  jq 1.5
  kubectl 1.8.2
  less 487
  maven 3.5.2
  minikube 0.23.0
  modd 0.4
  ngrok 4VmDzA7iaHb
  nodejs 9.0.0
  notepadplusplus 7.5.1 [extras]
  nvm 1.1.5
  openjdk 1.8.0.151-1
  openssh 5.4p1-1
  openssl 1.1.0f
  oraclejdk 8u151-b12 [extras]
  packer 1.1.1
  postgresql 10.0
  python 3.6.3
  redis 3.2.100
  ripgrep 0.7.1
  rust 1.21.0
  sed 4.2.1
  shasum 0.2013.09.29
  sqlite 3210000
  sslscan 1.11.0
  sudo 0.2017.03.24
  sysinternals 2017.09.16 [extras]
  terraform 0.10.8
  up 0.3.0
  vault 0.8.3
  yarn 1.2.1
  youtube-dl 2017.10.29

C:\Users\klauer
λ  cat .\scoop-apps.txt
C:\Users\klauer
λ

image

Another look at the regex:

image

@r15ch13
Copy link
Member

r15ch13 commented Nov 2, 2017

That's because scoop list uses Write-Host to show the list. Write-Host can't be piped to other commands. Try scoop export, it uses Write-Output

@rasa
Copy link
Member

rasa commented Mar 12, 2018

This appears to be resolved. If not, let us know. Thanks.

@GamerClassN7
Copy link

Would be nice to have command to completely export settings (Buckets, Installet apps, Version) so on new compute you can just type import FILE and all application will be installed automatically

@AnotherFoxGuy
Copy link

Here is a version of the export command that uses scoop export

# export app names to scoop-apps.txt
(scoop export) | sls '^([\w-]+)' |% { $_.matches.groups[1].value } > scoop-apps.txt

# install apps from scoop-apps.txt
$apps = gc scoop-apps.txt
scoop install @apps

@rofrol
Copy link

rofrol commented Apr 8, 2021

Thanks. I am doing this to have bucket/app list:

(scoop export) | sls '^([\w-]+) .* \[(.*)\]$' |% { "$($_.matches.groups[2])/$($_.matches.groups[1])" }

@redactedscribe
Copy link

Thanks. I am doing this to have bucket/app list:

(scoop export) | ...

Some buckets (main/extras/...?) contain apps with . in their names. I haven't encountered any underscores, but some buckets may use them. Here's a slight modification:

(scoop export) | sls '^([\w\._-]+) .* \[(.*)\]$' |% { "$($_.matches.groups[2])/$($_.matches.groups[1])" }

@rofrol
Copy link

rofrol commented Apr 16, 2021

Accepting all between spaces:

"someapp 2.32 [bucket1]`nsomegood._- 1.23 [bucket2]" -split "`n" | sls '^(.+) .+ \[(.+)\]$' |% { "$($_.matches.groups[2])/$($_.matches.groups[1])" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants